Package org.robwork.sdurw
Class EAAd
- java.lang.Object
-
- org.robwork.sdurw.Rotation3DVectord
-
- org.robwork.sdurw.EAAd
-
public class EAAd extends Rotation3DVectord
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 EAAd()
Constructs an EAA vector initialized to \{0,0,0\}EAAd(double thetakx, double thetaky, double thetakz)
Constructs an initialized EAA vector
\thetak = \left[\begin{array}{c} \theta k_x\\ \theta k_y\\ \theta k_z \end{array}\right]EAAd(long cPtr, boolean cMemoryOwn)
EAAd(EAAd eaa)
EAAd(Rotation3Dd 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 = \piEAAd(Vector3Dd eaa)
Constructs an initialized EAA vector
The angle of the EAA are \|eaa\| and the axis is \frac{eaa}{\|eaa\|}EAAd(Vector3Dd axis, double angle)
Constructs an initialized EAA vectorEAAd(Vector3Dd v1, Vector3Dd 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 double
angle()
Extracts the angle of rotation \thetaVector3Dd
axis()
Extracts the axis of rotation vector \mathbf{\hat{\mathbf{k}}}void
delete()
boolean
equals(EAAd rhs)
Comparison operator.
The comparison operator makes a element wise comparison.
Returns true only if all elements are equal.
double
get(long i)
static long
getCPtr(EAAd obj)
void
set(long i, double d)
long
size()
Get the size of the EAA.Rotation3Dd
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 \thetajava.lang.String
toString()
double
x()
double
y()
double
z()
-
Methods inherited from class org.robwork.sdurw.Rotation3DVectord
getCPtr
-
-
-
-
Constructor Detail
-
EAAd
public EAAd(long cPtr, boolean cMemoryOwn)
-
EAAd
public EAAd(Rotation3Dd 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
-
EAAd
public EAAd()
Constructs an EAA vector initialized to \{0,0,0\}
-
EAAd
public EAAd(Vector3Dd axis, double angle)
Constructs an initialized EAA vector- Parameters:
axis
- [in] \mathbf{\hat{k}}angle
- [in] \theta
-
EAAd
public EAAd(double thetakx, double thetaky, double 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_xthetaky
- [in] \theta k_ythetakz
- [in] \theta k_z
-
EAAd
public EAAd(Vector3Dd v1, Vector3Dd 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 vectorv2
- [in] normalized vector
-
EAAd
public EAAd(Vector3Dd 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
-
EAAd
public EAAd(EAAd eaa)
-
-
Method Detail
-
getCPtr
public static long getCPtr(EAAd obj)
-
delete
public void delete()
- Overrides:
delete
in classRotation3DVectord
-
angle
public double angle()
Extracts the angle of rotation \theta- Returns:
- \theta
-
toRotation3D
public Rotation3Dd 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 classRotation3DVectord
- Returns:
- The rotation matrix
-
axis
public Vector3Dd axis()
Extracts the axis of rotation vector \mathbf{\hat{\mathbf{k}}}- Returns:
- \mathbf{\hat{\mathbf{k}}}
-
equals
public boolean equals(EAAd 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 double x()
-
y
public double y()
-
z
public double z()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
get
public double get(long i)
-
set
public void set(long i, double d)
-
-