Squared length of the vector. This is faster than Length
, and can be used for things like comparing distances, as long as only squared values are used.
Squared length of the vector. This is faster than Length
, and can be used for things like comparing distances, as long as only squared values are used.
To use the LengthSquared
property, simply access it from an instance of the Vector3
struct. For example:
Vector3 vector = new Vector3(1, 2, 3);
float squaredLength = vector.LengthSquared;
<code>Vector3 vector = new Vector3(1, 2, 3); float squaredLength = vector.LengthSquared;</code>