sqrt

The square root of a value.

sqrt(x: Val): Expr

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

Parameters

NameTypeNotes
xVal

Example

const dist = sqrt(add(mul(dx, dx), mul(dy, dy)))

See also

  • length — The length of a vector.
  • pow — The first value raised to the power of the second.

Used by

Chrome, Crystal, Frost, Goo, Plastic, Sparkle, Waveform