Package org.robwork.sdurw_math
Class Rotation3D
- java.lang.Object
-
- org.robwork.sdurw_math.Rotation3D
-
public class Rotation3D extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description Rotation3D()A rotation matrix with uninitialized storage.Rotation3D(double r11, double r12, double r13, double r21, double r22, double r23, double r31, double r32, double r33)Rotation3D(long cPtr, boolean cMemoryOwn)Rotation3D(Vector3D i, Vector3D j, Vector3D k)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Rotation3Dassign(Rotation3DVector rot)Assignment of RotationVector to Rotation3Dvoiddelete()EigenMatrix3de()Returns a Eigen 3x3 matrix \mathbf{M}\in SO(3) that represents this rotation
booleanequal(Rotation3D rot)Compares rotations with a given precision
Performs an element wise comparison.booleanequal(Rotation3D rot, double precision)Compares rotations with a given precision
Performs an element wise comparison.booleanequals(Rotation3D rhs)Comparison operator.
The comparison operator makes a element wise comparison.
Returns true only if all elements are equal.
doubleget(long row, long column)Vector3DgetCol(long i)Returns the i'th column of the rotation matrixstatic longgetCPtr(Rotation3D obj)Vector3DgetRow(long i)Returns the i'th row of the rotation matrixstatic Rotation3Didentity()Rotation3Dinverse()Rotation3Dinverse(boolean copy)Calculate the inverse.booleanisProperRotation()Verify that this rotation is a proper rotation
booleanisProperRotation(double precision)Verify that this rotation is a proper rotation
EAAmultiply(EAA rhs)InertiaMatrixdmultiply(InertiaMatrixd rhs)Rotation3Dmultiply(Rotation3D bRc)Calculates \robabx{a}{c}{\mathbf{R}} = \robabx{a}{b}{\mathbf{R}} \robabx{b}{c}{\mathbf{R}}
static voidmultiply(Rotation3D a, Rotation3D b, Rotation3D result)Write to result the product a * b.static voidmultiply(Rotation3D a, Vector3D b, Vector3D result)Write to result the product a * b.Vector3Dmultiply(Vector3D bVc)Calculates \robabx{a}{c}{\mathbf{v}} = \robabx{a}{b}{\mathbf{R}} \robabx{b}{c}{\mathbf{v}}
VelocityScrew6Dmultiply(VelocityScrew6D rhs)Wrench6Dmultiply(Wrench6D rhs)voidnormalize()Normalizes the rotation matrix to satisfy SO(3).
Makes a normalization of the rotation matrix such that the columns
are normalized and othogonal s.t.booleannotEqual(Rotation3D rhs)Comparison operator.
The comparison operator makes a element wise comparison.
Returns true if any of the elements are different.
voidset(long row, long column, double d)static Rotation3Dskew(Vector3D v)Creates a skew symmetric matrix from a Vector3D.java.lang.StringtoString()doubletr()
-
-
-
Method Detail
-
getCPtr
public static long getCPtr(Rotation3D obj)
-
delete
public void delete()
-
identity
public static Rotation3D identity()
-
normalize
public void normalize()
Normalizes the rotation matrix to satisfy SO(3).
Makes a normalization of the rotation matrix such that the columns
are normalized and othogonal s.t. it belongs to SO(3).
-
get
public double get(long row, long column)
-
set
public void set(long row, long column, double d)
-
getRow
public Vector3D getRow(long i)
Returns the i'th row of the rotation matrix- Parameters:
i- [in] Index of the row to return. Only valid indices are 0, 1 and 2.
-
getCol
public Vector3D getCol(long i)
Returns the i'th column of the rotation matrix- Parameters:
i- [in] Index of the column to return. Only valid indices are 0, 1 and 2.
-
equals
public boolean equals(Rotation3D rhs)
Comparison operator.
The comparison operator makes a element wise comparison.
Returns true only if all elements are equal.
- Parameters:
rhs- [in] Rotation to compare with- Returns:
- True if equal.
-
notEqual
public boolean notEqual(Rotation3D rhs)
Comparison operator.
The comparison operator makes a element wise comparison.
Returns true if any of the elements are different.
- Parameters:
rhs- [in] Rotation to compare with- Returns:
- True if not equal.
-
equal
public boolean equal(Rotation3D rot, double precision)
Compares rotations with a given precision
Performs an element wise comparison. Two elements are considered equal if the difference
are less than precision.
- Parameters:
rot- [in] Rotation to compare withprecision- [in] The precision to use for testing- Returns:
- True if all elements are less than precision apart.
-
equal
public boolean equal(Rotation3D rot)
Compares rotations with a given precision
Performs an element wise comparison. Two elements are considered equal if the difference
are less than precision.
- Parameters:
rot- [in] Rotation to compare with
- Returns:
- True if all elements are less than precision apart.
-
isProperRotation
public boolean isProperRotation()
Verify that this rotation is a proper rotation
- Returns:
- True if this rotation is considered a proper rotation
-
isProperRotation
public boolean isProperRotation(double precision)
Verify that this rotation is a proper rotation
- Returns:
- True if this rotation is considered a proper rotation
-
e
public EigenMatrix3d e()
Returns a Eigen 3x3 matrix \mathbf{M}\in SO(3) that represents this rotation
- Returns:
- \mathbf{M}\in SO(3)
-
multiply
public Rotation3D multiply(Rotation3D bRc)
Calculates \robabx{a}{c}{\mathbf{R}} = \robabx{a}{b}{\mathbf{R}} \robabx{b}{c}{\mathbf{R}}
- Parameters:
bRc- [in] \robabx{b}{c}{\mathbf{R}}
- Returns:
- \robabx{a}{c}{\mathbf{R}}
-
multiply
public Vector3D multiply(Vector3D bVc)
Calculates \robabx{a}{c}{\mathbf{v}} = \robabx{a}{b}{\mathbf{R}} \robabx{b}{c}{\mathbf{v}}
- Parameters:
bVc- [in] \robabx{b}{c}{\mathbf{v}}- Returns:
- \robabx{a}{c}{\mathbf{v}}
-
skew
public static Rotation3D skew(Vector3D v)
Creates a skew symmetric matrix from a Vector3D. Also
known as the cross product matrix of v.
- Parameters:
v- [in] vector to create Skew matrix from
-
multiply
public static void multiply(Rotation3D a, Rotation3D b, Rotation3D result)
Write to result the product a * b.
-
multiply
public static void multiply(Rotation3D a, Vector3D b, Vector3D result)
Write to result the product a * b.
-
inverse
public Rotation3D inverse()
-
inverse
public Rotation3D inverse(boolean copy)
Calculate the inverse.- Parameters:
copy- [in] if coopy is false, This function changes the object that it is invoked
on, but this is about x5 faster than rot = inverse( rot ). else it changes the object,
making it a bit slower.- Returns:
- the inverse rotation.
-
tr
public double tr()
-
assign
public Rotation3D assign(Rotation3DVector rot)
Assignment of RotationVector to Rotation3D- Parameters:
rot- [in] Rotation input
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
multiply
public InertiaMatrixd multiply(InertiaMatrixd rhs)
-
multiply
public VelocityScrew6D multiply(VelocityScrew6D rhs)
-
-