static float DeltaRadians( float from, float to )

robot_2Generated
code_blocksInput

Description

The DeltaRadians method calculates the smallest difference between two angles in radians. This is useful for determining the shortest path of rotation between two angles, which is particularly important in scenarios involving circular motion or rotations.

Usage

Use the DeltaRadians method when you need to find the minimal angular difference between two angles in radians. This method is static and can be called directly on the MathX class.

Example

// Example usage of DeltaRadians
float angle1 = 1.5f; // in radians
float angle2 = 3.0f; // in radians

float delta = MathX.DeltaRadians(angle1, angle2);
// delta now holds the smallest difference between angle1 and angle2 in radians.