generated from mwc/project_drawing
ADjust ellipse starting angle
This commit is contained in:
parent
c027ffbf9f
commit
02902dac51
|
@ -12,15 +12,16 @@ def ellipse(rx, ry, num_points, points_to_draw=None):
|
||||||
the +x direction, and ends in the same position and heading.
|
the +x direction, and ends in the same position and heading.
|
||||||
"""
|
"""
|
||||||
radians()
|
radians()
|
||||||
|
φstart = get_angle(rx, ry, num_points, 0) / 2
|
||||||
fly(rx)
|
fly(rx)
|
||||||
left(π/2)
|
left(π/2 - φstart)
|
||||||
for i in range(points_to_draw or num_points):
|
for i in range(points_to_draw or num_points):
|
||||||
φi = get_angle(rx, ry, num_points, i)
|
φi = get_angle(rx, ry, num_points, i)
|
||||||
di = get_distance(rx, ry, num_points, i)
|
di = get_distance(rx, ry, num_points, i)
|
||||||
print(i, φi, di)
|
print(i, φi, di)
|
||||||
left(φi)
|
left(φi)
|
||||||
forward(di)
|
forward(di)
|
||||||
left(-π/2)
|
left(-π/2 + φstart)
|
||||||
fly(-rx)
|
fly(-rx)
|
||||||
degrees()
|
degrees()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue