ostk.mathematics.geometry.d3.transformation.rotation.RotationVector

class RotationVector(*args, **kwargs)

Bases: pybind11_object

Overloaded function.

  1. __init__(self: ostk.mathematics.geometry.d3.transformation.rotation.RotationVector, axis: numpy.ndarray[numpy.float64[3, 1]], angle: ostk::mathematics::geometry::Angle) -> None

    Create a rotation vector from axis and angle.

    Args:

    axis (numpy.array): The rotation axis (will be normalized). angle (Angle): The rotation angle around the axis.

    Example:
    >>> axis = numpy.array([0.0, 0.0, 1.0])
    >>> angle = Angle.degrees(90.0)
    >>> rot_vector = RotationVector(axis, angle)
    
  2. __init__(self: ostk.mathematics.geometry.d3.transformation.rotation.RotationVector, vector: numpy.ndarray[numpy.float64[3, 1]], angle_unit: ostk::mathematics::geometry::Angle::Unit) -> None

    Create a rotation vector from a vector representation.

    Args:

    vector (numpy.array): The rotation vector (magnitude represents angle). angle_unit (Angle.Unit): The unit of the angle in the vector magnitude.

    Example:
    >>> vector = numpy.array([0.0, 0.0, 1.5708])  # π/2 in z-axis
    >>> rot_vector = RotationVector(vector, Angle.Unit.Radian)
    

Methods

euler_angle

Create a rotation vector from Euler angles.

get_angle

Get the rotation angle.

get_axis

Get the rotation axis vector.

is_defined

Check if the rotation vector is defined.

quaternion

Create a rotation vector from a quaternion.

rectify

Rectify the rotation vector in-place (ensure angle is in [0, π]).

rotation_matrix

Create a rotation vector from a rotation matrix.

to_string

Overloaded function.

undefined

Create an undefined rotation vector.

unit

Create a unit rotation vector (no rotation).

x

Create a rotation vector around the x-axis.

y

Create a rotation vector around the y-axis.

z

Create a rotation vector around the z-axis.

static euler_angle(
euler_angle: ostk::mathematics::geometry::d3::transformation::rotation::EulerAngle,
) ostk.mathematics.geometry.d3.transformation.rotation.RotationVector

Create a rotation vector from Euler angles.

Parameters:

euler_angle (EulerAngle) -- The Euler angles to convert.

Returns:

The equivalent rotation vector.

Return type:

RotationVector

Example

>>> ea = EulerAngle.zyx(Angle.degrees(30), Angle.degrees(45), Angle.degrees(60))
>>> rot_vector = RotationVector.euler_angle(ea)
get_angle(
self: ostk.mathematics.geometry.d3.transformation.rotation.RotationVector,
) ostk::mathematics::geometry::Angle

Get the rotation angle.

Returns:

The rotation angle around the axis.

Return type:

Angle

Example

>>> rot_vector = RotationVector(axis, Angle.degrees(90.0))
>>> angle = rot_vector.get_angle()  # 90 degrees
get_axis(
self: ostk.mathematics.geometry.d3.transformation.rotation.RotationVector,
) numpy.ndarray[numpy.float64[3, 1]]

Get the rotation axis vector.

Returns:

The normalized rotation axis.

Return type:

Vector3d

Example

>>> rot_vector = RotationVector(numpy.array([1.0, 0.0, 0.0]), angle)
>>> axis = rot_vector.get_axis()  # [1.0, 0.0, 0.0]
is_defined(
self: ostk.mathematics.geometry.d3.transformation.rotation.RotationVector,
) bool

Check if the rotation vector is defined.

Returns:

True if the rotation vector is defined, False otherwise.

Return type:

bool

Example

>>> rot_vector = RotationVector(axis, angle)
>>> rot_vector.is_defined()  # True
static quaternion(
quaternion: ostk.mathematics.geometry.d3.transformation.rotation.Quaternion,
) ostk.mathematics.geometry.d3.transformation.rotation.RotationVector

Create a rotation vector from a quaternion.

Parameters:

quaternion (Quaternion) -- The quaternion to convert.

Returns:

The equivalent rotation vector.

Return type:

RotationVector

Example

>>> q = Quaternion.unit()
>>> rot_vector = RotationVector.quaternion(q)
rectify(
self: ostk.mathematics.geometry.d3.transformation.rotation.RotationVector,
) None

Rectify the rotation vector in-place (ensure angle is in [0, π]).

Example

>>> rot_vector = RotationVector(axis, Angle.degrees(270.0))
>>> rot_vector.rectify()  # Converts to equivalent rotation with angle ≤ π
static rotation_matrix(
rotation_matrix: ostk::mathematics::geometry::d3::transformation::rotation::RotationMatrix,
) ostk.mathematics.geometry.d3.transformation.rotation.RotationVector

Create a rotation vector from a rotation matrix.

Parameters:

rotation_matrix (RotationMatrix) -- The rotation matrix to convert.

Returns:

The equivalent rotation vector.

Return type:

RotationVector

Example

>>> rm = RotationMatrix.identity()
>>> rot_vector = RotationVector.rotation_matrix(rm)
to_string(*args, **kwargs)

Overloaded function.

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

    Convert the rotation vector to string representation.

    Returns:

    str: String representation of the rotation vector.

    Example:
    >>> rot_vector = RotationVector.unit()
    >>> rot_vector.to_string()
    
  2. to_string(self: ostk.mathematics.geometry.d3.transformation.rotation.RotationVector, precision: ostk.core.type.Integer) -> ostk.core.type.String

    Convert the rotation vector to string representation with specified precision.

    Args:

    precision (int): The precision for floating point numbers.

    Returns:

    str: String representation of the rotation vector.

    Example:
    >>> rot_vector = RotationVector.unit()
    >>> rot_vector.to_string(3)
    
static undefined() ostk.mathematics.geometry.d3.transformation.rotation.RotationVector

Create an undefined rotation vector.

Returns:

An undefined rotation vector.

Return type:

RotationVector

Example

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

Create a unit rotation vector (no rotation).

Returns:

A rotation vector representing no rotation.

Return type:

RotationVector

Example

>>> unit_vector = RotationVector.unit()
>>> angle = unit_vector.get_angle()  # 0 degrees
static x(
angle: ostk::mathematics::geometry::Angle,
) ostk.mathematics.geometry.d3.transformation.rotation.RotationVector

Create a rotation vector around the x-axis.

Parameters:

angle (Angle) -- The rotation angle around the x-axis.

Returns:

A rotation vector around the x-axis.

Return type:

RotationVector

Example

>>> rot_vector = RotationVector.x(Angle.degrees(90.0))
static y(
angle: ostk::mathematics::geometry::Angle,
) ostk.mathematics.geometry.d3.transformation.rotation.RotationVector

Create a rotation vector around the y-axis.

Parameters:

angle (Angle) -- The rotation angle around the y-axis.

Returns:

A rotation vector around the y-axis.

Return type:

RotationVector

Example

>>> rot_vector = RotationVector.y(Angle.degrees(90.0))
static z(
angle: ostk::mathematics::geometry::Angle,
) ostk.mathematics.geometry.d3.transformation.rotation.RotationVector

Create a rotation vector around the z-axis.

Parameters:

angle (Angle) -- The rotation angle around the z-axis.

Returns:

A rotation vector around the z-axis.

Return type:

RotationVector

Example

>>> rot_vector = RotationVector.z(Angle.degrees(90.0))