range steps
This commit is contained in:
parent
dca094220b
commit
9315b91d23
|
@ -1,4 +1,4 @@
|
|||
from math import sin, cos, atan2, radians
|
||||
from math import sin, cos, atan2, radians, sqrt
|
||||
|
||||
def get_step(start, end, speed):
|
||||
x0, y0 = start
|
||||
|
@ -28,3 +28,10 @@ def get_points_on_circle(center, radius, count, offset=0):
|
|||
current_angle + offset))
|
||||
current_angle += angle_step
|
||||
return points
|
||||
|
||||
def get_range_steps(start, end, count):
|
||||
for ii in xrange(count):
|
||||
yield start + (end - start) * ii / float(count - 1)
|
||||
|
||||
def get_distance(p0, p1):
|
||||
return sqrt((p0[0] - p1[0]) ** 2 + (p0[1] - p1[1]) ** 2)
|
Loading…
Reference in New Issue