The Distance
method calculates the angular distance between the current Rotation
instance and another specified Rotation
instance. The result is returned as a float
representing the angle in degrees.
The Distance
method calculates the angular distance between the current Rotation
instance and another specified Rotation
instance. The result is returned as a float
representing the angle in degrees.
To use the Distance
method, you need to have two Rotation
instances. Call the method on one instance and pass the other instance as a parameter. The method will return the angular distance between the two rotations.
// Create two Rotation instances Rotation rotation1 = Rotation.FromAxis(new Vector3(0, 1, 0), 45); Rotation rotation2 = Rotation.FromAxis(new Vector3(0, 1, 0), 90); // Calculate the distance between the two rotations float distance = rotation1.Distance(rotation2); // Output the distance // Note: Use a logging method appropriate for your environment // e.g., Log.Info($"Distance: {distance}");