Name
CanvasRenderingContext2D.arc( ): add an arc to the current subpath of a canvas, using a center point and radius
Synopsis
void arc(floatx
, floaty
, floatradius
, floatstartAngle
,endAngle
, booleancounterclockwise
)
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 end points 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 describe specify a start point and an end point 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 end points to the subpath. The final argument specifies the direction in which the circle should be traversed to connect the start and end points. This method leaves the current point set to the end point of the arc.
See Also
CanvasRenderingContext2D.arcTo(
)
|
CanvasRenderingContext2D.beginPath(
)
|
CanvasRenderingContext2D.closePath(
)
|
Get JavaScript: The Definitive Guide, 5th Edition 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.