atan2
The angle of the point (x, y) in radians, −π..π.
atan2(y: Val, x: Val): Expr
Import math from shaders/std and use math.atan2.
Takes y first. Turns an offset from a center into an angle around it.
Parameters
| Name | Type | Notes |
|---|---|---|
y | Val | |
x | Val |
Example
const angle = atan2(delta.member('y'), delta.member('x'))