- Synopsis
**ELLIPSEARC2**`arc.angle`

`y.semiaxis`

`x.semiaxis`

`start.angle`

- Description
Moves the turtle clockwise over an elliptic arc. The arc spans

degrees of the ellipse, starting at the point described by`arc.angle`

degrees and ending at the point described by (`start.angle`

+`start.angle`

).`arc.angle`

The size and shape of the elliptic arc can visualized in the following manner. First, imagine an ellipse drawn in the center of the screen, such that the

is the distance from the center to the ellipse along the X-axis and`x.semiaxis`

is the distance from the center to the ellipse along the Y-axis. ELLIPSEARC2 draws part of this ellipse, an arc between two points on the ellipse. The starting point for this arc can be visualized by imagining a turtle at the ellipse's center with a HEADING of`y.semiaxis`

. Wherever this turtle intersects the ellipse as it moves forward is the starting point of the arc. The ending point can be similarly imagined as if that turtle had turned RIGHT an additional`start.angle`

degrees before moving forward to intersect the ellipse.`arc.angle`

The position and orientation of the ellipse arc more difficult to understand, especially since the elliptic arc is not always drawn from where the turtle starts to where the turtle ends up. However, there are two simple cases. First, if

is a multiple of 90 degrees, then the arc is drawn tangent to the turtle's heading. Second, if`start.angle`

and`start.angle`

sum to a multiple of 90 degrees, then the turtle ends up tangent to the arc which is drawn.`arc.angle`

Despite the confusing behavior, it is straight-forward to use ELLIPSEARC2 to iteratively draw contiguous segments of an ellipse. If your first call has a

of 0 and in each subsequent call, the`start.angle`

is the sum of all`start.angle`

inputs previously given, you'll end drawing contiguous ellipse arcs, even though the intermediate turtle positions may not lie on the ellipse.`arc.angle`

Normally, the arc is drawn in clockwise direction, but if the

input is negative, then the turtle moves backward in a counter-clockwise direction.`arc.angle`

- Example
A simple 2D example:

`ELLIPSEARC2 90 100 200 0 ELLIPSEARC2 90 50 100 0`

A 2D ellipse built out of multiple consecutive arcs:

`SETPENSIZE 10 SETPENCOLOR "RED ELLIPSEARC2 90 150 100 0 SETPENCOLOR "LIME ELLIPSEARC2 90 150 100 90 SETPENCOLOR "BLUE ELLIPSEARC2 90 150 100 180 SETPENCOLOR "YELLOW ELLIPSEARC2 90 150 100 270`

An ellipse drawn with a dashed line using multiple consecutive arcs:

`REPEAT 36 [ PENDOWN ELLIPSEARC2 10 50 200 REPCOUNT*20-20 PENUP ELLIPSEARC2 10 50 200 REPCOUNT*20-10 ]`

A 3D example:

`PERSPECTIVE REPEAT 72 [ELLIPSEARC2 90 50 100 0 RIGHTROLL 5]`

- See Also
ELLIPSEARC