ostk.mathematics.geometry.d3.transformation.rotation.EulerAngle

class EulerAngle(*args, **kwargs)

Bases: pybind11_object

Overloaded function.

  1. __init__(self: ostk.mathematics.geometry.d3.transformation.rotation.EulerAngle, phi: ostk::mathematics::geometry::Angle, theta: ostk::mathematics::geometry::Angle, psi: ostk::mathematics::geometry::Angle, axis_sequence: ostk::mathematics::geometry::d3::transformation::rotation::EulerAngle::AxisSequence) -> None

    Create Euler angles from three angle components and axis sequence.

    Args:

    phi (Angle): The first rotation angle. theta (Angle): The second rotation angle. psi (Angle): The third rotation angle. axis_sequence (EulerAngle.AxisSequence): The axis sequence (XYZ, ZXY, ZYX).

    Example:
    >>> phi = Angle.degrees(30.0)
    >>> theta = Angle.degrees(45.0)
    >>> psi = Angle.degrees(60.0)
    >>> euler = EulerAngle(phi, theta, psi, EulerAngle.AxisSequence.XYZ)
    
  2. __init__(self: ostk.mathematics.geometry.d3.transformation.rotation.EulerAngle, vector: numpy.ndarray[numpy.float64[3, 1]], angle_unit: ostk::mathematics::geometry::Angle::Unit, axis_sequence: ostk::mathematics::geometry::d3::transformation::rotation::EulerAngle::AxisSequence) -> None

    Create Euler angles from a 3D vector with specified angle unit and axis sequence.

    Args:

    vector (numpy.array): Vector containing the three angle values. angle_unit (Angle.Unit): The unit of the angles in the vector. axis_sequence (EulerAngle.AxisSequence): The axis sequence.

    Example:
    >>> vector = numpy.array([30.0, 45.0, 60.0])
    >>> euler = EulerAngle(vector, Angle.Unit.Degree, EulerAngle.AxisSequence.XYZ)
    

Methods

is_defined

Check if the Euler angle is defined.

is_near

Check if this Euler angle is near another Euler angle within tolerance.

is_unitary

Check if the Euler angle represents a unit rotation.

quaternion

Create Euler angles from a quaternion with specified axis sequence.

rotation_matrix

rotation_vector

to_string

Overloaded function.

to_vector

Convert the Euler angle to a 3D vector with specified unit.

undefined

Create an undefined Euler angle.

unit

Create a unit Euler angle (no rotation).

xyz

Create Euler angles with XYZ axis sequence.

zxy

Create Euler angles with ZXY axis sequence.

zyx

Create Euler angles with ZYX axis sequence.

Attributes

axis_sequence

phi

psi

theta

class AxisSequence(
self: ostk.mathematics.geometry.d3.transformation.rotation.EulerAngle.AxisSequence,
value: int,
)

Bases: pybind11_object

Members:

Undefined

XYZ

ZXY

ZYX

property name
is_defined(
self: ostk.mathematics.geometry.d3.transformation.rotation.EulerAngle,
) bool

Check if the Euler angle is defined.

Returns:

True if the Euler angle is defined, False otherwise.

Return type:

bool

Example

>>> euler = EulerAngle(phi, theta, psi, EulerAngle.AxisSequence.XYZ)
>>> euler.is_defined()  # True
is_near(
self: ostk.mathematics.geometry.d3.transformation.rotation.EulerAngle,
euler_angle: ostk.mathematics.geometry.d3.transformation.rotation.EulerAngle,
angular_tolerance: ostk::mathematics::geometry::Angle,
) bool

Check if this Euler angle is near another Euler angle within tolerance.

Parameters:
  • euler_angle (EulerAngle) -- The Euler angle to compare with.

  • angular_tolerance (Angle) -- The angular tolerance for comparison.

Returns:

True if angles are within tolerance, False otherwise.

Return type:

bool

Example

>>> euler1 = EulerAngle(phi1, theta1, psi1, sequence)
>>> euler2 = EulerAngle(phi2, theta2, psi2, sequence)
>>> euler1.is_near(euler2, Angle.degrees(1.0))
is_unitary(
self: ostk.mathematics.geometry.d3.transformation.rotation.EulerAngle,
) bool

Check if the Euler angle represents a unit rotation.

Returns:

True if the Euler angle is unitary, False otherwise.

Return type:

bool

Example

>>> euler = EulerAngle.unit()
>>> euler.is_unitary()  # True
static quaternion(
quaternion: ostk.mathematics.geometry.d3.transformation.rotation.Quaternion,
axis_sequence: ostk::mathematics::geometry::d3::transformation::rotation::EulerAngle::AxisSequence,
) ostk.mathematics.geometry.d3.transformation.rotation.EulerAngle

Create Euler angles from a quaternion with specified axis sequence.

Parameters:
Returns:

The equivalent Euler angles.

Return type:

EulerAngle

Example

>>> quat = Quaternion.unit()
>>> euler = EulerAngle.quaternion(quat, EulerAngle.AxisSequence.XYZ)
static rotation_matrix(
rotation_matrix: ostk.mathematics.geometry.d3.transformation.rotation.RotationMatrix,
axis_sequence: ostk::mathematics::geometry::d3::transformation::rotation::EulerAngle::AxisSequence,
) ostk.mathematics.geometry.d3.transformation.rotation.EulerAngle
static rotation_vector(
rotation_vector: ostk.mathematics.geometry.d3.transformation.rotation.RotationVector,
axis_sequence: ostk::mathematics::geometry::d3::transformation::rotation::EulerAngle::AxisSequence,
) ostk.mathematics.geometry.d3.transformation.rotation.EulerAngle
to_string(*args, **kwargs)

Overloaded function.

  1. to_string(self: ostk.mathematics.geometry.d3.transformation.rotation.EulerAngle) -> ostk.core.type.String

  2. to_string(self: ostk.mathematics.geometry.d3.transformation.rotation.EulerAngle, angle_unit: ostk::mathematics::geometry::Angle::Unit) -> ostk.core.type.String

to_vector(
self: ostk.mathematics.geometry.d3.transformation.rotation.EulerAngle,
angle_unit: ostk::mathematics::geometry::Angle::Unit,
) numpy.ndarray[numpy.float64[3, 1]]

Convert the Euler angle to a 3D vector with specified unit.

Parameters:

angle_unit (Angle.Unit) -- The unit for the output vector angles.

Returns:

A vector containing [phi, theta, psi] in the specified unit.

Return type:

Vector3d

Example

>>> euler = EulerAngle(phi, theta, psi, EulerAngle.AxisSequence.XYZ)
>>> vector = euler.to_vector(Angle.Unit.Degree)
static undefined() ostk.mathematics.geometry.d3.transformation.rotation.EulerAngle

Create an undefined Euler angle.

Returns:

An undefined Euler angle object.

Return type:

EulerAngle

Example

>>> undefined_euler = EulerAngle.undefined()
>>> undefined_euler.is_defined()  # False
static unit() ostk.mathematics.geometry.d3.transformation.rotation.EulerAngle

Create a unit Euler angle (no rotation).

Returns:

A unit Euler angle representing no rotation.

Return type:

EulerAngle

Example

>>> unit_euler = EulerAngle.unit()
>>> unit_euler.is_unitary()  # True
static xyz(
phi: ostk::mathematics::geometry::Angle,
theta: ostk::mathematics::geometry::Angle,
psi: ostk::mathematics::geometry::Angle,
) ostk.mathematics.geometry.d3.transformation.rotation.EulerAngle

Create Euler angles with XYZ axis sequence.

Parameters:
  • phi (Angle) -- The first rotation angle around X-axis.

  • theta (Angle) -- The second rotation angle around Y-axis.

  • psi (Angle) -- The third rotation angle around Z-axis.

Returns:

An Euler angle with XYZ sequence.

Return type:

EulerAngle

Example

>>> euler = EulerAngle.xyz(Angle.degrees(30.0), Angle.degrees(45.0), Angle.degrees(60.0))
static zxy(
phi: ostk::mathematics::geometry::Angle,
theta: ostk::mathematics::geometry::Angle,
psi: ostk::mathematics::geometry::Angle,
) ostk.mathematics.geometry.d3.transformation.rotation.EulerAngle

Create Euler angles with ZXY axis sequence.

Parameters:
  • phi (Angle) -- The first rotation angle around Z-axis.

  • theta (Angle) -- The second rotation angle around X-axis.

  • psi (Angle) -- The third rotation angle around Y-axis.

Returns:

An Euler angle with ZXY sequence.

Return type:

EulerAngle

Example

>>> euler = EulerAngle.zxy(Angle.degrees(30.0), Angle.degrees(45.0), Angle.degrees(60.0))
static zyx(
phi: ostk::mathematics::geometry::Angle,
theta: ostk::mathematics::geometry::Angle,
psi: ostk::mathematics::geometry::Angle,
) ostk.mathematics.geometry.d3.transformation.rotation.EulerAngle

Create Euler angles with ZYX axis sequence.

Parameters:
  • phi (Angle) -- The first rotation angle around Z-axis.

  • theta (Angle) -- The second rotation angle around Y-axis.

  • psi (Angle) -- The third rotation angle around X-axis.

Returns:

An Euler angle with ZYX sequence.

Return type:

EulerAngle

Example

>>> euler = EulerAngle.zyx(Angle.degrees(30.0), Angle.degrees(45.0), Angle.degrees(60.0))