Description
The Inverse
property of the Rotation
struct provides the inverse of the current rotation. The inverse of a rotation is essentially the rotation that, when combined with the original rotation, results in no rotation (identity rotation). This is useful in scenarios where you need to reverse a rotation or apply the opposite rotation to an object.
Usage
To use the Inverse
property, simply access it from an instance of the Rotation
struct. This property is read-only and returns a new Rotation
instance representing the inverse of the original rotation.
Example
// Example of using the Inverse property
Rotation originalRotation = Rotation.FromAxis(new Vector3(0, 1, 0), 90);
Rotation inverseRotation = originalRotation.Inverse;
// Applying the inverse rotation to the original should result in the identity rotation
Rotation result = originalRotation * inverseRotation;
// Check if the result is the identity rotation
bool isIdentity = result == Rotation.Identity;