Skip to content

ARC ​

Draws an arc based on an ellipse's outline in a segment between two semi-straight lines.

Syntax ​

leo-grammar
ARC [ x:measureValue ] [ y:measureValue ] [ rx:measureValue ] [ ry:measureValue ]
    [ x1:measureValue ] [ y1:measureValue ] [ x2:measureValue ] [ y2:measureValue ] .

Parameters ​

  • x (measureValue, optional) - The x-coordinate of the ellipse's center. The default is 0cm.
  • y (measureValue, optional) - The y-coordinate of the ellipse's center. The default is 0cm.
  • rx (measureValue, optional) - The horizontal radius (half the width) of the ellipse. The default is 0cm.
  • ry (measureValue, optional) - The vertical radius (half the height) of the ellipse. The default is 0cm.
  • x1 (measureValue, optional) - The x-coordinate of the first line originating in the ellipse's center. The default is 0cm.
  • y1 (measureValue, optional) - The y-coordinate of the first line originating in the ellipse's center. The default is 0cm.
  • x2 (measureValue, optional) - The x-coordinate of the second line originating in the ellipse's center. The default is 0cm.
  • y2 (measureValue, optional) - The y-coordinate of the second line originating in the ellipse's center. The default is 0cm.

Details ​

The style of this command is defined by the PEN command.

Arcs are based on ellipse's, in which (semi-straight) lines originating in the ellipse's center (x, y) define a sector. The first line takes its course through point (x1, y1) and the second through point (x2, y2). The arc is drawn counter-clockwise between the intersection of the ellipse with the first line and the intersection of the ellipse with the second line.

The points provided for the semi-straight lines should be located outside of the "virtual" ellipse. Otherwise the results can have minor graphical errors.

Rotation is only partially performed. This has an influence on the drawing of relations where the ellipse that the arc is based on will always ignore any kind of rotation and will be drawn as if the relation was going horizontal from the left to the right. The points for the two lines are however rotated. If a rotation is necessary then use a BEZIER or a CURVE instead.

This command differs from PIE in that it only draws the outline along the ellipse.

See Also ​

Examples ​

Draw an arc in the bottom half of an ellipse.
An arc on the lower half of an invisible ellipse

leo
GRAPHREP
SHADOW off

ARC x:0cm y:0cm rx:1.5cm ry:1cm
    x1:-2cm y1:2cm x2:2cm y2:0cm

Draw an arc in the bottom half of an ellipse and visualize the "virtual" ellipse and semi-straight lines.
An arc on the lower half where the ellipse and the semi-straight lines are also visualized

leo
GRAPHREP
SHADOW off

# Draw the "virtual" ellipse and lines used for the ARC.
PEN color:"gray"
ELLIPSE x:0cm y:0cm rx:1.5cm ry:1cm
LINE x2:-2cm y2:2cm
LINE x2:2cm y2:0cm

# Draw the ARC.
PEN
ARC x:0cm y:0cm rx:1.5cm ry:1cm
    x1:-2cm y1:2cm x2:2cm y2:0cm

Versions and Changes ​

Available since ADOxx 1.3