math.mag2

Syntax

f := math.mag2(v)

Get the squared vector magnitude. This is useful as a measure of vector length without the cost of calling the math.sqrt function.

Returns:

f - vector squared magnitude

Arguments:

v - vector (2D or 3D)