invLength

taichi_glsl.vector.invLength(x)

Calculate the inverse of length of a vector.

invLength returns the inverse of the magnitude of the vector, i.e., 1 / sqrt(x[0] ** 2 + x[1] * 2 + …).

Parameters

x – Specifies a vector of which to calculate the length.

Returns

The return value can be calculated as inversesqrt(dot(x, x)).

See also

length(), normalize(), inversesqrt().