HTML canvas rotate() Method
Example
let c = document.getElementById("myCanvas");
let ctx = c.getContext("2d");
ctx.rotate(25 * Math.PI / 125);
ctx.fillRect(50, 0, 100, 50);
Meaning
The rotate() method rotates the current drawing.
Standard Syntax
JavaScript syntax:
context.rotate(angle);
Advertisement
Parameter Values
| Parameter | Description |
|---|---|
| angle | Specifies the rotation angle, in radians. |