Name
CanvasRenderingContext2D.rotate( ): rotate the coordinate system of the canvas
Synopsis
void rotate(floatangle)Arguments
-
angle The amount of rotation, in radians. Positive values result in clockwise rotation, and negative values result in counterclockwise rotation.
Description
This method alters the mapping between canvas coordinates and
the pixels of the <canvas>
element in the web browser so that any subsequent drawing appears
rotated within the canvas by the specified angle. It does not rotate
the <canvas> element
itself. Note that the angle is specified in radians. To convert
degrees to radians, multiply by Math.PI and divide by 180.
See Also
CanvasRenderingContext2D.scale(
), CanvasRenderingContext2D.translate(
)
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access