cos

The cosine of an angle in radians, −1..1.

cos(x: Val): Expr

Import math from shaders/std and use math.cos.

Parameters

NameTypeNotes
xVal

Example

const spun = rotate2(delta, cos(angle), sin(angle))

Tip. A degrees prop needs mul(angle, 0.017453292519943295) first.

See also

  • sin — The sine of an angle in radians, −1..1.
  • rotate2 — A 2D point rotated around the origin.

Used by

Chrome, Crystal, FlowingGradient, Goo, MeshGradient, ReactionDiffusion, Voxels