AggPas - Anti-Grain Geomertry for Object Pascal

TAgg2D.ArcTo(rx, ry, angle, largeArcFlag, sweepFlag, x, y)

Description

Adds an xARC_TO_ABS path command to the current subpath. A new Arc segment starts at the Current Point position and ends at defined coordinates. Current Point is finally changed to be at the end of a new Arc segment.

Path Arc is a slice of complete ellipse whose geometry is defined by radius on X and Y axis and rotation, which indicates how the ellipse as a whole is rotated relative to the current coordinate system. The center (cx, cy) of the ellipse is calculated automatically to satisfy the constraints imposed by the other parameters - large arc and sweep flag. Following illustration shows, how combination of those two flags affects the computation of the resulting arc:

Four possible arcs between two points

The four arcs connecting the points are labeled L and S for large and small, and CW and CCW for clockwise and counter-clockwise.

If defined parameters doesn't meet requirements for the minimum size of underlying ellipse (eg. radiuses are too small), a direct Line segment to the destination coordinates will be drawn.

If destination coordinates equals to the Current Point coordinates, nothing will be drawn. So if user wants to draw visually complete ellipse at a given Current Point, he has to define the destination coordinates with an very small dilation like eg. 0.1 pixels or so.

Parameters

rx: double

Ellipse radius on X axis [in subpixels].

ry: double

Ellipse radius on Y axis [in subpixels].

angle: double

Overall X axis rotation of ellipse [clockwise in radians].

largeArcFlag: boolean

If TRUE, L = Large Arc.

If FALSE, S = Small Arc.

sweepFlag: boolean

If TRUE, CW = Clock Wise.

If FALSE, CCW = Counter Clock Wise.

x: double

X coordinate of end of a new Arc segment [in subpixels].

y: double

Y coordinate of end of a new Arc segment [in subpixels].

Example

See the Path Example page.