MCPcopy Index your code
hub / github.com/Jack-Cherish/python-spider / get_track

Method get_track

geetest.py:225–259  ·  view source on GitHub ↗

根据偏移量获取移动轨迹 :param distance: 偏移量 :return: 移动轨迹

(self, distance)

Source from the content-addressed store, hash-verified

223 return left
224
225 def get_track(self, distance):
226 """
227 根据偏移量获取移动轨迹
228 :param distance: 偏移量
229 :return: 移动轨迹
230 """
231 # 移动轨迹
232 track = []
233 # 当前位移
234 current = 0
235 # 减速阈值
236 mid = distance * 4 / 5
237 # 计算间隔
238 t = 0.2
239 # 初速度
240 v = 0
241
242 while current < distance:
243 if current < mid:
244 # 加速度为正2
245 a = 2
246 else:
247 # 加速度为负3
248 a = -3
249 # 初速度v0
250 v0 = v
251 # 当前速度v = v0 + at
252 v = v0 + a * t
253 # 移动距离x = v0t + 1/2 * a * t^2
254 move = v0 * t + 1 / 2 * a * t * t
255 # 当前位移
256 current += move
257 # 加入轨迹
258 track.append(round(move))
259 return track
260
261 def get_slider(self):
262 """

Callers 1

crackMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected