Class EAAf


  • public class EAAf
    extends Rotation3DVectorf
    A class for representing an equivalent angle-axis rotation

    This class defines an equivalent-axis-angle orientation vector also known
    as an \thetak vector or "axis+angle" vector

    The equivalent-axis-angle vector is the product of a unit vector \hat{\mathbf{k}} and an angle of rotation around that axis \theta

    Note: given two EAA vectors \theta_1\mathbf{\hat{k}}_1 and \theta_2\mathbf{\hat{k}}_2 it is generally not possible to subtract
    or add these vectors, except for the special case when \mathbf{\hat{k}}_1 == \mathbf{\hat{k}}_2 this is why this class does
    not have any subtraction or addition operators
    • Constructor Summary

      Constructors 
      Constructor Description
      EAAf()
      Constructs an EAA vector initialized to \{0,0,0\}
      EAAf​(float thetakx, float thetaky, float thetakz)
      Constructs an initialized EAA vector
      \thetak = \left[\begin{array}{c} \theta k_x\\ \theta k_y\\ \theta k_z \end{array}\right]
      EAAf​(long cPtr, boolean cMemoryOwn)  
      EAAf​(EAAf eaa)  
      EAAf​(Rotation3Df rot)
      Extracts Equivalent axis-angle vector from Rotation matrix



      \theta = arccos(\frac{1}{2}(Trace(\mathbf{R})-1)=arccos(\frac{r_{11}+r_{22}+r_{33}-1}{2})

      \thetak=log(\mathbf{R})=\frac{\theta}{2 sin \theta}(\mathbf{R}-\mathbf{R}^T) = \frac{\theta}{2 sin \theta} \left[ \begin{array}{c} r_{32}-r_{23}\\ r_{13}-r_{31}\\ r_{21}-r_{12} \end{array} \right]

      \thetak= \left[ \begin{array}{c} 0\\ 0\\ 0 \end{array} \right] if \theta = 0

      \thetak=\pi \left[ \begin{array}{c} \sqrt{(R(0,0)+1.0)/2.0}\\ \sqrt{(R(1,1)+1.0)/2.0}\\ \sqrt{(R(2,2)+1.0)/2.0} \end{array} \right] if \theta = \pi
      EAAf​(Vector3Df eaa)
      Constructs an initialized EAA vector

      The angle of the EAA are \|eaa\| and the axis is \frac{eaa}{\|eaa\|}
      EAAf​(Vector3Df axis, float angle)
      Constructs an initialized EAA vector
      EAAf​(Vector3Df v1, Vector3Df v2)
      Constructs an EAA vector that will rotate v1 into
      v2.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      float angle()
      Extracts the angle of rotation \theta
      Vector3Df axis()
      Extracts the axis of rotation vector \mathbf{\hat{\mathbf{k}}}
      void delete()  
      boolean equals​(EAAf rhs)
      Comparison operator.

      The comparison operator makes a element wise comparison.
      Returns true only if all elements are equal.

      float get​(long i)  
      static long getCPtr​(EAAf obj)  
      void set​(long i, float d)  
      long size()
      Get the size of the EAA.
      Rotation3Df toRotation3D()


      \mathbf{R} = e^{[\mathbf{\hat{k}}],\theta}=\mathbf{I}^{3x3}+[\mathbf{\hat{k}}] sin\theta+[{\mathbf{\hat{k}}}]^2(1-cos\theta) = \left[ \begin{array}{ccc} k_xk_xv\theta + c\theta k_xk_yv\theta - k_zs\theta k_xk_zv\theta + k_ys\theta \\ k_xk_yv\theta + k_zs\theta k_yk_yv\theta + c\theta k_yk_zv\theta - k_xs\theta\\ k_xk_zv\theta - k_ys\theta k_yk_zv\theta + k_xs\theta k_zk_zv\theta + c\theta \end{array} \right]

      where:
      - c\theta = cos \theta
      - s\theta = sin \theta
      - v\theta = 1-cos \theta
      java.lang.String toString()  
      float x()  
      float y()  
      float z()  
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • EAAf

        public EAAf​(long cPtr,
                    boolean cMemoryOwn)
      • EAAf

        public EAAf​(Rotation3Df rot)
        Extracts Equivalent axis-angle vector from Rotation matrix



        \theta = arccos(\frac{1}{2}(Trace(\mathbf{R})-1)=arccos(\frac{r_{11}+r_{22}+r_{33}-1}{2})

        \thetak=log(\mathbf{R})=\frac{\theta}{2 sin \theta}(\mathbf{R}-\mathbf{R}^T) = \frac{\theta}{2 sin \theta} \left[ \begin{array}{c} r_{32}-r_{23}\\ r_{13}-r_{31}\\ r_{21}-r_{12} \end{array} \right]

        \thetak= \left[ \begin{array}{c} 0\\ 0\\ 0 \end{array} \right] if \theta = 0

        \thetak=\pi \left[ \begin{array}{c} \sqrt{(R(0,0)+1.0)/2.0}\\ \sqrt{(R(1,1)+1.0)/2.0}\\ \sqrt{(R(2,2)+1.0)/2.0} \end{array} \right] if \theta = \pi
      • EAAf

        public EAAf()
        Constructs an EAA vector initialized to \{0,0,0\}
      • EAAf

        public EAAf​(Vector3Df axis,
                    float angle)
        Constructs an initialized EAA vector
        Parameters:
        axis - [in] \mathbf{\hat{k}}
        angle - [in] \theta
      • EAAf

        public EAAf​(float thetakx,
                    float thetaky,
                    float thetakz)
        Constructs an initialized EAA vector
        \thetak = \left[\begin{array}{c} \theta k_x\\ \theta k_y\\ \theta k_z \end{array}\right]
        Parameters:
        thetakx - [in] \theta k_x
        thetaky - [in] \theta k_y
        thetakz - [in] \theta k_z
      • EAAf

        public EAAf​(Vector3Df v1,
                    Vector3Df v2)
        Constructs an EAA vector that will rotate v1 into
        v2. Where v1 and v2 are normalized and described in the same reference frame.
        Parameters:
        v1 - [in] normalized vector
        v2 - [in] normalized vector
      • EAAf

        public EAAf​(Vector3Df eaa)
        Constructs an initialized EAA vector

        The angle of the EAA are \|eaa\| and the axis is \frac{eaa}{\|eaa\|}
        Parameters:
        eaa - [in] Values to initialize the EAA
      • EAAf

        public EAAf​(EAAf eaa)
    • Method Detail

      • getCPtr

        public static long getCPtr​(EAAf obj)
      • angle

        public float angle()
        Extracts the angle of rotation \theta
        Returns:
        \theta
      • toRotation3D

        public Rotation3Df toRotation3D()


        \mathbf{R} = e^{[\mathbf{\hat{k}}],\theta}=\mathbf{I}^{3x3}+[\mathbf{\hat{k}}] sin\theta+[{\mathbf{\hat{k}}}]^2(1-cos\theta) = \left[ \begin{array}{ccc} k_xk_xv\theta + c\theta k_xk_yv\theta - k_zs\theta k_xk_zv\theta + k_ys\theta \\ k_xk_yv\theta + k_zs\theta k_yk_yv\theta + c\theta k_yk_zv\theta - k_xs\theta\\ k_xk_zv\theta - k_ys\theta k_yk_zv\theta + k_xs\theta k_zk_zv\theta + c\theta \end{array} \right]

        where:
        - c\theta = cos \theta
        - s\theta = sin \theta
        - v\theta = 1-cos \theta
        Overrides:
        toRotation3D in class Rotation3DVectorf
        Returns:
        The rotation matrix
      • axis

        public Vector3Df axis()
        Extracts the axis of rotation vector \mathbf{\hat{\mathbf{k}}}
        Returns:
        \mathbf{\hat{\mathbf{k}}}
      • equals

        public boolean equals​(EAAf rhs)
        Comparison operator.

        The comparison operator makes a element wise comparison.
        Returns true only if all elements are equal.

        Parameters:
        rhs - [in] EAA to compare with
        Returns:
        True if equal.
      • size

        public long size()
        Get the size of the EAA.
        Returns:
        the size (always 3).
      • x

        public float x()
      • y

        public float y()
      • z

        public float z()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • get

        public float get​(long i)
      • set

        public void set​(long i,
                        float d)