Header menu logo Euclid

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

Cos

Full Usage: Cos

Field type: float

The Cosine component of this rotation. The range of these field is -1.0 to +1.0

Field type: float

Sin

Full Usage: Sin

Field type: float

The Sine component of this rotation. The range of these field is -1.0 to +1.0

Field type: float

Instance members

Instance member Description

this.Add

Full Usage: this.Add

Parameters:
Returns: Rotation2D
Modifiers: inline

Create a new 2D Rotation that adds 2D Rotation to the existing one.

ro : Rotation2D
Returns: Rotation2D

this.AddDegrees

Full Usage: this.AddDegrees

Parameters:
    deg : float

Returns: Rotation2D
Modifiers: inline

Create a new 2D Rotation that adds and angle in Degrees to the existing one.

deg : float
Returns: Rotation2D

this.AddRadians

Full Usage: this.AddRadians

Parameters:
    rad : float

Returns: Rotation2D
Modifiers: inline

Create a new 2D Rotation that adds and angle in Radians to the existing one.

rad : float
Returns: Rotation2D

this.InDegrees

Full Usage: this.InDegrees

Returns: float
Modifiers: inline

Returns the angle represented by this 2D Rotation in Degrees.

Returns: float

this.InRadians

Full Usage: this.InRadians

Returns: float
Modifiers: inline

Returns the angle represented by this 2D Rotation in Radians.

Returns: float

this.Inverse

Full Usage: this.Inverse

Returns: Rotation2D
Modifiers: inline

Returns the 2D Rotation in the opposite direction.

Returns: Rotation2D

Static members

Static member Description

Rotation2D.createFromDegrees deg

Full Usage: Rotation2D.createFromDegrees deg

Parameters:
    deg : float

Returns: Rotation2D

Construct 2D Rotation from angle in Degree.

deg : float
Returns: Rotation2D

Rotation2D.createFromRadians rad

Full Usage: Rotation2D.createFromRadians rad

Parameters:
    rad : float

Returns: Rotation2D

Construct 2D Rotation from angle in Radians

rad : float
Returns: Rotation2D

Rotation2D.createFromVectors (a, b)

Full Usage: Rotation2D.createFromVectors (a, b)

Parameters:
Returns: Rotation2D
a : Vc
b : Vc
Returns: Rotation2D

Rotation2D.createFromVectors (a, b)

Full Usage: Rotation2D.createFromVectors (a, b)

Parameters:
Returns: Rotation2D
a : UnitVc
b : UnitVc
Returns: Rotation2D

Rotation2D.createUnchecked (sine, cosine)

Full Usage: Rotation2D.createUnchecked (sine, cosine)

Parameters:
    sine : float
    cosine : float

Returns: Rotation2D

Construct 2D Rotation from sine and corresponding cosine directly. Input is unchecked and not validated.

sine : float
cosine : float
Returns: Rotation2D

Rotation2D.equals tol a b

Full Usage: Rotation2D.equals tol a b

Parameters:
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.

tol : float
a : Rotation2D
b : Rotation2D
Returns: bool

Type something to start searching.