rotate2
A 2D point rotated around the origin.
rotate2(p: Val, cosA: Val, sinA: Val): Expr
Import math from shaders/std and use math.rotate2.
Pass the cosine and sine of the angle in radians, computed once, and the same pair rotates every point.
Parameters
| Name | Type | Notes |
|---|---|---|
p | Val | |
cosA | Val | |
sinA | Val |
Example
const spun = local(rotate2(delta, cos(angle), sin(angle)), 'spun')