Please enable JavaScript to view this site.

ESL Documentation

Within a boundary, you can also draw an arc from the current position of the graphics cursor to a specified endpoint.

 

You can optionally specify the direction in which the arc is to be drawn. The direction of the arc is specified by the keywords clockwise or counter clockwise. If you omit both of these specifications and provide a positive integer value for the endpoints, the arc is drawn counterclockwise.

 

In the draw arc to statement, the specified X and Y values are absolute positions in the coordinate position of the object. If the graphics cursor is at position 0 100, the statement:

 

draw arc to 100 200 clockwise center at 100 100

 

draws the following arc:

 

_img291

In the draw arc by statement, the endpoint of the arc is the position created by adding the specified X and Y values to the current coordinates of the graphics cursor. For example, if the graphics cursor is at position 0 100, the statement:

 

draw arc by 100 100 clockwise center at 100 100

 

draws an arc to position 100 200, as shown below:

_img291

 

Sometimes it is not possible to draw an arc exactly as specified. When ESL draws an arc, each point along the arc is equidistant from the point defined as the arc's center. When you draw an arc to a specified endpoint using the to specification, and if the starting point and the endpoint of the arc are not the same distance from the center, the arc cannot touch both the starting and ending points and still be circular. In this case, the arc is drawn with the starting point and the center exactly as specified, and the endpoint of the arc is drawn as close as possible to the specified endpoint, while preserving the circularity of the arc. For example, in the following statements:

 

move to 50 0

    draw arc to 50 50 center at 0 0

 

the starting point of the arc is at position 0 50; the center at 0 0. The arc is drawn with the endpoint as close as possible to position 50 50 while still maintaining the rule that each point on the arc is the same distance from the center as each other point. The arc that results from these statements is shown below:

_img292

 

The endpoint of an arc drawn in this way always lies at a point along the radius from the center to the specified endpoint.

 

As discussed above, a draw arc to or a draw arc by statement that does not have a center specification assumes as its center the center specified for the previous arc in that graphical object.