Name

CRC.arc() — adds an arc, using a center point and radius

Synopsis

void arc(float x, float y, float radius, 
         float startAngle, endAngle,
         boolean counterclockwise)

Arguments

x, y

The coordinates of the center of the circle describing the arc.

radius

The radius of the circle describing the arc.

startAngle, endAngle

The angles that specify the start and endpoints of the arc along the circle. These angles are measured in radians. The three o’clock position along the positive X axis is an angle of 0, and angles increase in the clockwise direction.

counterclockwise

Whether the arc is traversed counterclockwise (true) or clockwise (false) along the circle’s circumference.

Description

The first five arguments to this method specify a start point and an endpoint on the circumference of a circle. Invoking this method adds a straight line between the current point and the start point to the current subpath. Next it adds the arc along the circumference of the circle between the start and endpoints to the subpath. The final argument specifies the direction in which the circle should be traversed to connect the start and endpoints. This method leaves the current point set to the endpoint of the arc.

Get Canvas Pocket Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.