Rotation2d Class
Represents a 2D rotation.
Features
Create a
Rotation2dobject from radians, degrees, or revolutions using thefrom_<unit>class methods. This is the most explicit and least error-prone way to use the class.Add or subtract two
Rotation2dobjects.Multiply or divide a
Rotation2dobject by a scalar.Check equality between two
Rotation2dobjects.Convert the angle to radians, degrees, or revolutions.
Calculate the sine, cosine, tangent, and their hyperbolic counterparts of the angle.
Calculate the inverse of a
Rotation2dobject.Normalize the rotation angle to the range -π to π radians.
Interpolate between two
Rotation2dobjects.
Imports
Usage Examples
Create a Rotation2d object from different units
Add two Rotation2d objects
Subtract two Rotation2d objects
Multiply a Rotation2d object by a scalar
Divide a Rotation2d object by a scalar
Check equality between two Rotation2d objects
Convert the angle to different units
Calculate the sine, cosine, and tangent of the angle
Calculate the inverse of a Rotation2d object
Normalize the rotation angle
Interpolate between two Rotation2d objects
Explanation of Normalization
The normalization process for a Rotation2d object involves adjusting the rotation angle to ensure it falls within the range of -π to π radians. This is useful for maintaining consistency and avoiding issues with angles that exceed a full circle 2π radians). Rotation2d object will have an angle that is easy to work with and avoids complications from angles that are too large or too small.