The Inverse
property of the Vector3
struct returns the inverse of the vector. This is particularly useful for operations that involve scaling vectors, as it effectively inverts the direction of the vector while maintaining its magnitude.
The Inverse
property of the Vector3
struct returns the inverse of the vector. This is particularly useful for operations that involve scaling vectors, as it effectively inverts the direction of the vector while maintaining its magnitude.
To use the Inverse
property, simply access it on an instance of a Vector3
object. This will return a new Vector3
instance where each component of the original vector is inverted.
Vector3 originalVector = new Vector3(2.0f, -3.0f, 4.0f); Vector3 inverseVector = originalVector.Inverse; // inverseVector is now (-2.0f, 3.0f, -4.0f)