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.
|
||||
"""
|
||||
radians()
|
||||
φstart = get_angle(rx, ry, num_points, 0) / 2
|
||||
fly(rx)
|
||||
left(π/2)
|
||||
left(π/2 - φstart)
|
||||
for i in range(points_to_draw or num_points):
|
||||
φi = get_angle(rx, ry, num_points, i)
|
||||
di = get_distance(rx, ry, num_points, i)
|
||||
print(i, φi, di)
|
||||
left(φi)
|
||||
forward(di)
|
||||
left(-π/2)
|
||||
left(-π/2 + φstart)
|
||||
fly(-rx)
|
||||
degrees()
|
||||
|
||||
|
|
Loading…
Reference in New Issue