float Distance( Rotation to )

robot_2Generated
code_blocksInput

Description

The Distance method calculates the angular distance between the current Rotation instance and another specified Rotation instance. The result is returned as a single-precision floating-point value representing the angle in degrees.

Usage

To use the Distance method, call it on an instance of the Rotation struct, passing another Rotation instance as the parameter. This will return the angular distance between the two rotations.

Example

// Example of using the Distance method
Rotation rotation1 = Rotation.FromAxis(Vector3.Up, 45);
Rotation rotation2 = Rotation.FromAxis(Vector3.Up, 90);

float distance = rotation1.Distance(rotation2);
// distance will be 45.0f, representing the angular difference in degrees between the two rotations.