Package org.robwork.sdurw
Class Rotation3f
- java.lang.Object
-
- org.robwork.sdurw.Rotation3f
-
public class Rotation3f extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description Rotation3f()
A rotation matrix with uninitialized storage.Rotation3f(float v0, float v1, float v2, float v3, float v4, float v5, float v6, float v7, float v8)
Constructs an initialized 3x3 rotation matrixRotation3f(long cPtr, boolean cMemoryOwn)
Rotation3f(Rotation3f R)
Rotation3f(Vector3f i, Vector3f j, Vector3f 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(Rotation3f rot, float precision)
Compares rotations with a given precision
Performs an element wise comparison.boolean
equals(Rotation3f rhs)
Comparison operator.
The comparison operator makes a element wise comparison.
Returns true only if all elements are equal.
float
get(long row, long column)
Vector3f
getCol(long i)
Returns the i'th column of the rotation matrixstatic long
getCPtr(Rotation3f obj)
Vector3f
getRow(long i)
Returns the i'th row of the rotation matrix
static Rotation3f
identity()
Constructs a 3x3 rotation matrix set to identity
Rotation3f
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(float precision)
Verify that this rotation is a proper rotation
EAAf
multiply(EAAf bTKc)
InertiaMatrixf
multiply(InertiaMatrixf bRc)
Rotation3f
multiply(Rotation3f other)
Calculates this rotation multiplied by other rotation.
Vector3f
multiply(Vector3f 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, float d)
static Rotation3f
skew(Vector3f v)
Creates a skew symmetric matrix from a Vector3D.java.lang.String
toString()
-
-
-
Constructor Detail
-
Rotation3f
public Rotation3f(long cPtr, boolean cMemoryOwn)
-
Rotation3f
public Rotation3f()
A rotation matrix with uninitialized storage.
-
Rotation3f
public Rotation3f(float v0, float v1, float v2, float v3, float v4, float v5, float v6, float v7, float v8)
Constructs an initialized 3x3 rotation matrix
-
Rotation3f
public Rotation3f(Vector3f i, Vector3f j, Vector3f k)
Constructs an initialized 3x3 rotation matrix
-
Rotation3f
public Rotation3f(Rotation3f R)
-
-
Method Detail
-
getCPtr
public static long getCPtr(Rotation3f obj)
-
delete
public void delete()
-
identity
public static Rotation3f 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 Vector3f 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 Vector3f 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(Rotation3f 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(Rotation3f rot, float 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(float precision)
Verify that this rotation is a proper rotation
- Returns:
- True if this rotation is considered a proper rotation
-
multiply
public Rotation3f multiply(Rotation3f other)
Calculates this rotation multiplied by other rotation.
- Parameters:
other
- [in] rotation to multiply with
- Returns:
- the result of multiplication.
-
multiply
public Vector3f multiply(Vector3f vec)
Calculates this rotation multiplied by a vector.
- Parameters:
vec
- [in] vector to multiply with.
- Returns:
- the result of multiplication.
-
skew
public static Rotation3f skew(Vector3f 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 Rotation3f 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 float get(long row, long column)
-
set
public void set(long row, long column, float d)
-
multiply
public InertiaMatrixf multiply(InertiaMatrixf bRc)
-
-