Package org.robwork.sdurw_math
Class InertiaMatrixd
- java.lang.Object
-
- org.robwork.sdurw_math.InertiaMatrixd
-
public class InertiaMatrixd extends java.lang.Object
A 3x3 inertia matrix
-
-
Constructor Summary
Constructors Constructor Description InertiaMatrixd()
constructor - where only the diagonal is set
InertiaMatrixd(double i)
constructor - where only the diagonal is setInertiaMatrixd(double i, double j)
constructor - where only the diagonal is setInertiaMatrixd(double i, double j, double k)
constructor - where only the diagonal is setInertiaMatrixd(double r11, double r12, double r13, double r21, double r22, double r23, double r31, double r32, double r33)
InertiaMatrixd(long cPtr, boolean cMemoryOwn)
InertiaMatrixd(EigenMatrix3d r)
Construct an internal matrix from a Eigen::MatrixBase
It is the responsibility of the user that 3x3 matrix is indeed an
inertia matrix.InertiaMatrixd(Vector3D i, Vector3D j, Vector3D k)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description InertiaMatrixd
add(InertiaMatrixd I2)
Calculates the addition between the two InertiaMatricesvoid
delete()
Vector3D
diag()
get The diagonal of the MatrixEigenMatrix3d
e()
Returns reference to the internal 3x3 matrixboolean
equals(InertiaMatrixd 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)
static long
getCPtr(InertiaMatrixd obj)
static InertiaMatrixd
makeCuboidInertia(double mass, double x, double y, double z)
calculates the inertia of a cuboid where the reference frame is in the
center of the cuboid withstatic InertiaMatrixd
makeHollowSphereInertia(double mass, double radi)
Make inertia matrix for a hollow sphere.static InertiaMatrixd
makeSolidSphereInertia(double mass, double radi)
Make inertia matrix for a solid sphere.InertiaMatrixd
multiply(Rotation3D bRc)
Vector3D
multiply(Vector3D bVc)
Calculates \robabx{a}{c}{\mathbf{v}} = \robabx{a}{b}{\mathbf{R}} \robabx{b}{c}{\mathbf{v}}boolean
notEqual(InertiaMatrixd rhs)
Comparison operator.
The comparison operator makes a element wise comparison.
Returns true if any of the elements are different.
void
set(long row, long column, double d)
java.lang.String
toString()
-
-
-
Constructor Detail
-
InertiaMatrixd
public InertiaMatrixd(long cPtr, boolean cMemoryOwn)
-
InertiaMatrixd
public InertiaMatrixd(double r11, double r12, double r13, double r21, double r22, double r23, double r31, double r32, double r33)
-
InertiaMatrixd
public InertiaMatrixd(double i, double j, double k)
constructor - where only the diagonal is set- Parameters:
i
- [in] m(0,0)j
- [in] m(1,1)k
- [in] m(2,2)
-
InertiaMatrixd
public InertiaMatrixd(double i, double j)
constructor - where only the diagonal is set- Parameters:
i
- [in] m(0,0)j
- [in] m(1,1)
-
InertiaMatrixd
public InertiaMatrixd(double i)
constructor - where only the diagonal is set- Parameters:
i
- [in] m(0,0)
-
InertiaMatrixd
public InertiaMatrixd()
constructor - where only the diagonal is set
-
InertiaMatrixd
public InertiaMatrixd(EigenMatrix3d r)
Construct an internal matrix from a Eigen::MatrixBase
It is the responsibility of the user that 3x3 matrix is indeed an
inertia matrix.
-
-
Method Detail
-
getCPtr
public static long getCPtr(InertiaMatrixd obj)
-
delete
public void delete()
-
get
public double get(long row, long column)
-
set
public void set(long row, long column, double d)
-
e
public EigenMatrix3d e()
Returns reference to the internal 3x3 matrix
-
multiply
public InertiaMatrixd multiply(Rotation3D bRc)
-
add
public InertiaMatrixd add(InertiaMatrixd I2)
Calculates the addition between the two InertiaMatrices
-
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}}
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
equals
public boolean equals(InertiaMatrixd rhs)
Comparison operator.
The comparison operator makes a element wise comparison.
Returns true only if all elements are equal.
- Parameters:
rhs
- [in] InertiaMatrix to compare with- Returns:
- True if equal.
-
notEqual
public boolean notEqual(InertiaMatrixd rhs)
Comparison operator.
The comparison operator makes a element wise comparison.
Returns true if any of the elements are different.
- Parameters:
rhs
- [in] InertiaMatrix to compare with- Returns:
- True if not equal.
-
makeSolidSphereInertia
public static InertiaMatrixd makeSolidSphereInertia(double mass, double radi)
Make inertia matrix for a solid sphere.- Parameters:
mass
- [in] mass of solid sphere.radi
- [in] radius of sphere.- Returns:
- the inertia matrix.
-
makeHollowSphereInertia
public static InertiaMatrixd makeHollowSphereInertia(double mass, double radi)
Make inertia matrix for a hollow sphere.- Parameters:
mass
- [in] mass of hollow sphere.radi
- [in] radius of sphere.- Returns:
- the inertia matrix.
-
makeCuboidInertia
public static InertiaMatrixd makeCuboidInertia(double mass, double x, double y, double z)
calculates the inertia of a cuboid where the reference frame is in the
center of the cuboid with- Parameters:
mass
-x
-y
-z
-- Returns:
-
diag
public Vector3D diag()
get The diagonal of the Matrix- Returns:
- Vector3D< T >
-
-