Class AxisAngle

  • All Implemented Interfaces:
    Rotation<AxisAngle>, java.io.Serializable, javolution.lang.Immutable, javolution.lang.Realtime, javolution.lang.ValueType, javolution.xml.XMLSerializable

    public final class AxisAngle
    extends AbstractRotation<AxisAngle>
    implements javolution.xml.XMLSerializable

    This class represents a rotation axis and rotation angle made up of Float64 elements. AxisAngles may be used to represents a relative orientation (attitude or rotation transformation) between two different reference frames; B wrt A or BA. It can be used to transform coordinates in reference frame A to reference frame B (A2B).

    Reference: Wikipedia: Axis angle

    Modified by: Joseph A. Huwaldt

    Version:
    February 27, 2014
    Author:
    Joseph A. Huwaldt Date: October 22, 2009
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int THETA
      The index to the angular component of this axis angle rotation representation.
      static int X
      The index to the vector X component of this axis angle rotation representation's axis.
      static int Y
      The index to the vector Y component of this axis angle rotation representation's axis.
      static int Z
      The index to the vector Z component of this axis angle rotation representation's axis.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      AxisAngle copy()
      Returns a copy of this rotation transform allocated by the calling thread (possibly on the stack).
      AxisAngle divide​(Rotation<?> that)
      Returns the division of this rotation transform with the specified rotation transform.
      boolean equals​(java.lang.Object obj)
      Compares this AxisAngle against the specified object for strict equality (same rotation type and same values).
      Parameter<javax.measure.quantity.Angle> getAngle()
      Return the rotation angle.
      Vector3D<javax.measure.quantity.Dimensionless> getAxis()
      Returns the rotation axis part of this axis/angle rotation transformation as a unit vector.
      int hashCode()
      Returns the hash code for this rotation.
      AxisAngle times​(Rotation<?> that)
      Returns the product of this rotation transform with the specified rotation transform.
      DCMatrix toDCM()
      Returns a direction cosine transformation matrix from this axis/angle rotation.
      Quaternion toQuaternion()
      Returns a quaternion representing this rotation transformation.
      javolution.text.Text toText()
      Returns the text representation of this rotation transform.
      <Q extends javax.measure.quantity.Quantity>
      Vector3D<Q>
      transform​(Coordinate3D<Q> v)
      Transforms a 3D vector from frame A to B using this axis/angle rotation.
      AxisAngle transpose()
      Returns the spatial inverse of this transformation: AB rather than BA.
      static AxisAngle valueOf​(Rotation<?> transform)
      Returns a new AxisAngle instance constructed from the specified rotation transform.
      static AxisAngle valueOf​(Vector3D<?> axis, Parameter<javax.measure.quantity.Angle> angle)
      Returns a AxisAngle instance containing the specified rotation axis and rotation angle.
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Field Detail

      • X

        public static final int X
        The index to the vector X component of this axis angle rotation representation's axis.
        See Also:
        Constant Field Values
      • Y

        public static final int Y
        The index to the vector Y component of this axis angle rotation representation's axis.
        See Also:
        Constant Field Values
      • Z

        public static final int Z
        The index to the vector Z component of this axis angle rotation representation's axis.
        See Also:
        Constant Field Values
      • THETA

        public static final int THETA
        The index to the angular component of this axis angle rotation representation.
        See Also:
        Constant Field Values
    • Method Detail

      • valueOf

        public static AxisAngle valueOf​(Vector3D<?> axis,
                                        Parameter<javax.measure.quantity.Angle> angle)
        Returns a AxisAngle instance containing the specified rotation axis and rotation angle.
        Parameters:
        axis - The vector representing the rotation axis direction.
        angle - The rotation angle about the rotation axis.
        Returns:
        The axis/angle rotation transformation having the specified values.
      • valueOf

        public static AxisAngle valueOf​(Rotation<?> transform)
        Returns a new AxisAngle instance constructed from the specified rotation transform.
        Parameters:
        transform - The Rotation transform to convert to a new quaternion.
        Returns:
        the quaternion representing the specified attitude transform.
      • getAxis

        public Vector3D<javax.measure.quantity.Dimensionless> getAxis()
        Returns the rotation axis part of this axis/angle rotation transformation as a unit vector.
      • getAngle

        public Parameter<javax.measure.quantity.Angle> getAngle()
        Return the rotation angle.
      • times

        public AxisAngle times​(Rotation<?> that)
        Returns the product of this rotation transform with the specified rotation transform. If this axis/angle rotation is BA and that is AC then the returned value is: BC = BA times AC (or C2B = A2B times C2A).
        Specified by:
        times in interface Rotation<AxisAngle>
        Parameters:
        that - the rotation transform multiplier.
        Returns:
        this times that
      • divide

        public AxisAngle divide​(Rotation<?> that)
        Returns the division of this rotation transform with the specified rotation transform.
        Parameters:
        that - the rotation transform divisor.
        Returns:
        this / that
      • transform

        public <Q extends javax.measure.quantity.Quantity> Vector3D<Q> transform​(Coordinate3D<Q> v)
        Transforms a 3D vector from frame A to B using this axis/angle rotation.
        Specified by:
        transform in interface Rotation<AxisAngle>
        Parameters:
        v - the vector expressed in frame A.
        Returns:
        the vector expressed in frame B.
      • copy

        public AxisAngle copy()
        Returns a copy of this rotation transform allocated by the calling thread (possibly on the stack).
        Specified by:
        copy in interface Rotation<AxisAngle>
        Specified by:
        copy in interface javolution.lang.ValueType
        Returns:
        an identical and independent copy of this rotation transform.
      • toText

        public javolution.text.Text toText()
        Returns the text representation of this rotation transform.
        Specified by:
        toText in interface javolution.lang.Realtime
        Returns:
        the text representation of this rotation transform.
      • equals

        public boolean equals​(java.lang.Object obj)
        Compares this AxisAngle against the specified object for strict equality (same rotation type and same values).
        Overrides:
        equals in class java.lang.Object
        Parameters:
        obj - the object to compare with.
        Returns:
        true if this rotation is identical to that rotation; false otherwise.
      • hashCode

        public int hashCode()
        Returns the hash code for this rotation.
        Overrides:
        hashCode in class java.lang.Object
        Returns:
        the hash code value.