Rotation2D Type
2D Counter Clockwise rotation. It can be applied in World X, Y or Z plane. Internally stored just as a Sine and Cosine value. For arbitrary rotations use Quaternions or 4x4 Matrix. However this module has much better performance than the more general Matrix4x4 or a Quaternion. Note: Never use the struct default constructor Rotation2D() as it will create an invalid zero Rotation2D. Use Rotation2D.create or Rotation2D.createUnchecked instead.
Record fields
Record Field |
Description
|
Full Usage:
Cos
Field type: float
|
The Cosine component of this rotation. The range of these field is -1.0 to +1.0
|
Full Usage:
Sin
Field type: float
|
The Sine component of this rotation. The range of these field is -1.0 to +1.0
|
Instance members
Instance member |
Description
|
|
Create a new 2D Rotation that adds 2D Rotation to the existing one.
|
|
Create a new 2D Rotation that adds and angle in Degrees to the existing one.
|
|
Create a new 2D Rotation that adds and angle in Radians to the existing one.
|
Full Usage:
this.InDegrees
Returns: float
Modifiers: inline |
Returns the angle represented by this 2D Rotation in Degrees.
|
Full Usage:
this.InRadians
Returns: float
Modifiers: inline |
Returns the angle represented by this 2D Rotation in Radians.
|
|
Returns the 2D Rotation in the opposite direction.
|
Static members
Static member |
Description
|
|
|
|
|
|
|
|
|
Full Usage:
Rotation2D.createUnchecked (sine, cosine)
Parameters:
float
cosine : float
Returns: Rotation2D
|
Construct 2D Rotation from sine and corresponding cosine directly. Input is unchecked and not validated.
|
Full Usage:
Rotation2D.equals tol a b
Parameters:
float
a : Rotation2D
b : Rotation2D
Returns: bool
|
Checks if two 2D Rotations are equal within tolerance. By comparing the fields Sin and Cos each with the given tolerance. The range of these field is -1.0 to +1.0 Use a tolerance of 0.0 to check for an exact match.
|