SBPhysicalMatrix33#
This class represents a 3x3 physical matrix.
In a physical matrix (e.g., an inertia tensor), all components have the same unit (SBQuantity
), so that physical matrices are defined by only one unit.
SBPhysicalMatrix33() # a dimensionless 3x3 matrix
There are multiple convenience constructors available for the commonly used physical vectors:
These convenience constructors internally call SBPhysicalMatrix33
with proper SBQuantity
and can be used as follows, without specifying the SBQuantity
unit:
SBMatrix33(1.0) # a dimensionless 3x3 matrix with all components equal to 1
Dimensionless 3x3 matrices (SBMatrix33
) are especially useful since they are used to represent 3D reference frames, rotation matrices, rigid-body transforms, etc
SBMatrix33(1) == SBPhysicalMatrix33(1) # True
See also
SAMSON SDK: SBDTypePhysicalMatrix33
- class samson.SBPhysicalMatrix33(*args, **kwargs)#
Bases:
pybind11_object
This class represents 3x3 physical matrices.
SAMSON API: SBDTypePhysicalMatrix33
Overloaded function.
__init__(self: samson.SBPhysicalMatrix33) -> None
Constructs a physical matrix with all components set to zero.
__init__(self: samson.SBPhysicalMatrix33, d: samson.SBPhysicalVector3) -> None
Constructs the diagonal physical matrix with diagonal [ d.v[0] d.v[1] d.v[2] ].
__init__(self: samson.SBPhysicalMatrix33, c0: samson.SBPhysicalVector3, c1: samson.SBPhysicalVector3, c2: samson.SBPhysicalVector3) -> None
Constructs the physical matrix with columns c0, c1, and c2.
__init__(self: samson.SBPhysicalMatrix33, mat: list[list[samson.SBQuantity.unitsSI]]) -> None
Constructs the physical matrix from the quantity 2D array mat.
__init__(self: samson.SBPhysicalMatrix33, v: samson.SBQuantity.unitsSI) -> None
Constructs the physical matrix with all components set to v.
__init__(self: samson.SBPhysicalMatrix33, m00: samson.SBQuantity.unitsSI, m01: samson.SBQuantity.unitsSI, m02: samson.SBQuantity.unitsSI, m10: samson.SBQuantity.unitsSI, m11: samson.SBQuantity.unitsSI, m12: samson.SBQuantity.unitsSI, m20: samson.SBQuantity.unitsSI, m21: samson.SBQuantity.unitsSI, m22: samson.SBQuantity.unitsSI) -> None
Constructs the physical matrix from components m00, m01, m02, m10, m11, m12, m20, m21, and m22.
__init__(self: samson.SBPhysicalMatrix33, d: float) -> None
Constructs the dimensionless physical matrix with all components set to d.
__init__(self: samson.SBPhysicalMatrix33, mat: list[list[float]]) -> None
Constructs the dimensionless physical matrix from double 2D array mat.
__init__(self: samson.SBPhysicalMatrix33, m00: float, m01: float, m02: float, m10: float, m11: float, m12: float, m20: float, m21: float, m22: float) -> None
Constructs the dimensionless physical matrix from components m00, m01, m02, m10, m11, m12, m20, m21, and m22.
- __add__(self: samson.SBPhysicalMatrix33, arg0: samson.SBPhysicalMatrix33) samson.SBPhysicalMatrix33 #
- __eq__(self: samson.SBPhysicalMatrix33, arg0: samson.SBPhysicalMatrix33) bool #
- __iadd__(self: samson.SBPhysicalMatrix33, arg0: samson.SBPhysicalMatrix33) samson.SBPhysicalMatrix33 #
- __imul__(*args, **kwargs)#
Overloaded function.
__imul__(self: samson.SBPhysicalMatrix33, arg0: float) -> samson.SBPhysicalMatrix33
__imul__(self: samson.SBPhysicalMatrix33, arg0: samson.SBQuantity.unitsSI) -> samson.SBPhysicalMatrix33
- __isub__(self: samson.SBPhysicalMatrix33, arg0: samson.SBPhysicalMatrix33) samson.SBPhysicalMatrix33 #
- __itruediv__(*args, **kwargs)#
Overloaded function.
__itruediv__(self: samson.SBPhysicalMatrix33, arg0: float) -> samson.SBPhysicalMatrix33
__itruediv__(self: samson.SBPhysicalMatrix33, arg0: samson.SBQuantity.unitsSI) -> samson.SBPhysicalMatrix33
- __mul__(*args, **kwargs)#
Overloaded function.
__mul__(self: samson.SBPhysicalMatrix33, arg0: float) -> samson.SBPhysicalMatrix33
__mul__(self: samson.SBPhysicalMatrix33, arg0: samson.SBPhysicalVector3) -> samson.SBPhysicalVector3
__mul__(self: samson.SBPhysicalMatrix33, arg0: samson.SBPhysicalMatrix33) -> samson.SBPhysicalMatrix33
- __ne__(self: samson.SBPhysicalMatrix33, arg0: samson.SBPhysicalMatrix33) bool #
- __neg__(self: samson.SBPhysicalMatrix33) samson.SBPhysicalMatrix33 #
- __rmul__(self: samson.SBPhysicalMatrix33, arg0: float) samson.SBPhysicalMatrix33 #
- __sub__(self: samson.SBPhysicalMatrix33, arg0: samson.SBPhysicalMatrix33) samson.SBPhysicalMatrix33 #
- __truediv__(self: samson.SBPhysicalMatrix33, arg0: float) samson.SBPhysicalMatrix33 #
- computeEulerDecompositionZYZ(self: samson.SBPhysicalMatrix33) list[samson.SBQuantity.unitsSI] #
Computes a ZYZ Euler decomposition of this physical matrix.
- Returns:
phi (samson.SBQuantity) – The first Z rotation angle.
theta (samson.SBQuantity) – The Y rotation angle.
psi (samson.SBQuantity) – The second Z rotation angle.
- cosphi(self: samson.SBPhysicalMatrix33) samson.SBQuantity.unitsSI #
Returns the cosine of the rotation angle of this rotation matrix. This function assumes this physical matrix is a rotation matrix, and returns the cosine of the corresponding rotation angle.
- det(self: samson.SBPhysicalMatrix33) samson.SBQuantity.unitsSI #
Returns the determinant of this physical matrix.
- diagonalize(self: samson.SBPhysicalMatrix33) object #
Computes the eigenvalues ev and the eigenvectors p of this physical matrix.
- Parameters:
ev (samson.SBVector3) – Stores the eigenvalues when this function returns.
p (samson.SBMatrix33) – Stores the eigenvectors when this function returns.
- static fromAlignment(vectorFrom: samson.SBPhysicalVector3, vectorTo: samson.SBPhysicalVector3) samson.SBPhysicalMatrix33 #
Returns the dimensionless physical matrix that transforms vector vectorFrom into vector vectorTo. Precisely, left-multiplying vector vectorFrom by the resulting matrix produces vector vectorTo.
- static fromAxisAngle(axis: samson.SBPhysicalVector3, angle: samson.SBQuantity.unitsSI) samson.SBPhysicalMatrix33 #
Returns the dimensionless physical matrix corresponding to rotation axis and rotation angle (in radians).
- static fromAxisAnglePi(axis: samson.SBPhysicalVector3) samson.SBPhysicalMatrix33 #
Returns the dimensionless physical matrix corresponding to rotation axis axis and a rotation angle equal to Pi.
- static fromQuaternion(w: samson.SBQuantity.unitsSI, x: samson.SBQuantity.unitsSI, y: samson.SBQuantity.unitsSI, z: samson.SBQuantity.unitsSI) samson.SBPhysicalMatrix33 #
Returns the dimensionless physical matrix corresponding to quaternion [ w x y z ]
- getColumn(self: samson.SBPhysicalMatrix33, i: int) samson.SBPhysicalVector3 #
Returns the i-th column of this physical matrix
- getE1(self: samson.SBPhysicalMatrix33) samson.SBPhysicalVector3 #
Returns the first column of this physical matrix
- getE2(self: samson.SBPhysicalMatrix33) samson.SBPhysicalVector3 #
Returns the second column of this physical matrix
- getE3(self: samson.SBPhysicalMatrix33) samson.SBPhysicalVector3 #
Returns the third column of this physical matrix
- getRow(self: samson.SBPhysicalMatrix33, i: int) samson.SBPhysicalVector3 #
Returns the i-th row of this physical matrix
- static identity() samson.SBPhysicalMatrix33 #
Returns an identity physical matrix
- inverse(self: samson.SBPhysicalMatrix33) samson.SBPhysicalMatrix33 #
Returns the inverse of this physical matrix. This function assumes the physical matrix is invertible and returns its inverse.
- makeEulerRotationZYZ(self: samson.SBPhysicalMatrix33, phi: samson.SBQuantity.unitsSI, theta: samson.SBQuantity.unitsSI, psi: samson.SBQuantity.unitsSI) None #
This function sets this physical matrix from ZYZ Euler angles phi, theta and psi.
- Parameters:
phi (samson.SBQuantity) – The first Z rotation angle.
theta (samson.SBQuantity) – The Y rotation angle.
psi (samson.SBQuantity) – The second Z rotation angle.
- norm(self: samson.SBPhysicalMatrix33) samson.SBQuantity.unitsSI #
Returns the 2-norm of this physical matrix.
- orthonormalize(self: samson.SBPhysicalMatrix33) None #
Orthonormalizes this dimensionless physical matrix
- quasiStaticUpdate(self: samson.SBPhysicalMatrix33, wx: samson.SBQuantity.unitsSI, wy: samson.SBQuantity.unitsSI, wz: samson.SBQuantity.unitsSI) object #
Performs a quasi-static update of this dimensionless physical matrix using the rotation vector [ wx wy wz ].
- Parameters:
wx (samson.SBQuantity) – The first component of the rotation vector.
wy (samson.SBQuantity) – The second component of the rotation vector.
wz (samson.SBQuantity) – The third component of the rotation vector.
- Returns:
rotAngle - the rotation angle, rotAxis - the rotation axis, rotA - the rotation axis, rotB - the rotation axis, rotC - the rotation axis.
- Return type:
Tuple(samson.SBQuantity, samson.SBVector3, samson.SBMatrix33, samson.SBMatrix33, samson.SBMatrix33)
- revoluteJointZAxisMatrix(self: samson.SBPhysicalMatrix33, axis: samson.SBPhysicalVector3) None #
Sets this physical matrix to an orthonormal matrix whose third column is axis
- setE1(self: samson.SBPhysicalMatrix33, v: samson.SBPhysicalVector3) None #
Sets the first column of this physical matrix
- setE2(self: samson.SBPhysicalMatrix33, v: samson.SBPhysicalVector3) None #
Sets the second column of this physical matrix
- setE3(self: samson.SBPhysicalMatrix33, v: samson.SBPhysicalVector3) None #
Sets the third column of this physical matrix
- setIdentity(self: samson.SBPhysicalMatrix33) None #
Sets this physical matrix to the identity matrix.
- setZero(self: samson.SBPhysicalMatrix33) None #
Sets this physical matrix to zero.
- str(self: samson.SBPhysicalMatrix33, fullName: bool = False) str #
Converts the matrix to a string with a full unit name when fullName is True.
- swapColumns(self: samson.SBPhysicalMatrix33, i: int, j: int) None #
Swaps columns i and j.
- swapRows(self: samson.SBPhysicalMatrix33, i: int, j: int) None #
Swaps rows i and j.
- toQuaternion(self: samson.SBPhysicalMatrix33) list[samson.SBQuantity.unitsSI] #
Computes the quaternion [ w x y z ] corresponding to this physical matrix
- toRotationVector(self: samson.SBPhysicalMatrix33) samson.SBPhysicalVector3 #
Computes the rotation vector corresponding to this dimensionless physical matrix
- trace(self: samson.SBPhysicalMatrix33) samson.SBQuantity.unitsSI #
Returns the trace m[0][0] + m[1][1] + m[2][2] of this physical matrix.
- transpose(self: samson.SBPhysicalMatrix33) samson.SBPhysicalMatrix33 #
Returns the transpose of this physical matrix.
- property isDimensionless#
Returns True if the matrix is dimensionless
- property value#