Package org.robwork.sdurw
Class Rotation3d
- java.lang.Object
-
- org.robwork.sdurw.Rotation3d
-
public class Rotation3d extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description Rotation3d()
A rotation matrix with uninitialized storage.Rotation3d(double v0, double v1, double v2, double v3, double v4, double v5, double v6, double v7, double v8)
Constructs an initialized 3x3 rotation matrixRotation3d(long cPtr, boolean cMemoryOwn)
Rotation3d(Rotation3d R)
Rotation3d(Vector3d i, Vector3d j, Vector3d k)
Constructs an initialized 3x3 rotation matrix
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
delete()
boolean
equal(Rotation3d rot, double precision)
Compares rotations with a given precision
Performs an element wise comparison.boolean
equals(Rotation3d rhs)
Comparison operator.
The comparison operator makes a element wise comparison.
Returns true only if all elements are equal.
double
get(long row, long column)
Vector3d
getCol(long i)
Returns the i'th column of the rotation matrixstatic long
getCPtr(Rotation3d obj)
Vector3d
getRow(long i)
Returns the i'th row of the rotation matrix
static Rotation3d
identity()
Constructs a 3x3 rotation matrix set to identity
Rotation3d
inverse()
Calculate the inverse.
Note: This function changes the object that it is invoked on, but this is about x5 faster than rot = inverse( rot )
boolean
isProperRotation()
Verify that this rotation is a proper rotation
boolean
isProperRotation(double precision)
Verify that this rotation is a proper rotation
EAAd
multiply(EAAd bTKc)
InertiaMatrixd
multiply(InertiaMatrixd bRc)
Rotation3d
multiply(Rotation3d other)
Calculates this rotation multiplied by other rotation.
Vector3d
multiply(Vector3d vec)
Calculates this rotation multiplied by a vector.
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.void
set(long row, long column, double d)
static Rotation3d
skew(Vector3d v)
Creates a skew symmetric matrix from a Vector3D.java.lang.String
toString()
-
-
-
Constructor Detail
-
Rotation3d
public Rotation3d(long cPtr, boolean cMemoryOwn)
-
Rotation3d
public Rotation3d()
A rotation matrix with uninitialized storage.
-
Rotation3d
public Rotation3d(double v0, double v1, double v2, double v3, double v4, double v5, double v6, double v7, double v8)
Constructs an initialized 3x3 rotation matrix
-
Rotation3d
public Rotation3d(Vector3d i, Vector3d j, Vector3d k)
Constructs an initialized 3x3 rotation matrix
-
Rotation3d
public Rotation3d(Rotation3d R)
-
-
Method Detail
-
getCPtr
public static long getCPtr(Rotation3d obj)
-
delete
public void delete()
-
identity
public static Rotation3d identity()
Constructs a 3x3 rotation matrix set to identity
- Returns:
- a 3x3 identity rotation matrix
-
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).
-
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.
-
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.
-
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
-
multiply
public Rotation3d multiply(Rotation3d other)
Calculates this rotation multiplied by other rotation.
- Parameters:
other
- [in] rotation to multiply with
- Returns:
- the result of multiplication.
-
multiply
public Vector3d multiply(Vector3d vec)
Calculates this rotation multiplied by a vector.
- Parameters:
vec
- [in] vector to multiply with.
- Returns:
- the result of multiplication.
-
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
-
inverse
public Rotation3d inverse()
Calculate the inverse.
Note: This function changes the object that it is invoked on, but this is about x5 faster than rot = inverse( rot )
- Returns:
- the inverse rotation.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
get
public double get(long row, long column)
-
set
public void set(long row, long column, double d)
-
multiply
public InertiaMatrixd multiply(InertiaMatrixd bRc)
-
-