Python: module mat3
 
mat3
index


 
3x3 matrix class
 
In addition to the classes and functions described here, there is the
function
 
  rotVector(vec, angle) - return matrix corresponding to rotation about 
                          3-vector vec by angle (in radians)

 
Classes
       
cdsMatrix.CDSMatrix_double(builtins.object)
Mat3
cdsMatrix.SymMatrix_double(builtins.object)
SymMat3

 
class Mat3(cdsMatrix.CDSMatrix_double)
    Mat3(m11=0, m12=0, m13=0, m21=0, m22=0, m23=0, m31=0, m32=0, m33=0, colVecs=None, rowVecs=None)
 

 
 
Method resolution order:
Mat3
cdsMatrix.CDSMatrix_double
builtins.object

Methods defined here:
__init__(s, m11=0, m12=0, m13=0, m21=0, m22=0, m23=0, m31=0, m32=0, m33=0, colVecs=None, rowVecs=None)
Mat3 has a specialized constructor which allows all matrix elements
to be enumerated as arguments. example:
m=Mat3(1,2,3,
       4,5,6,
       7,8,9)
 
Matrix elements can alternatively be specified by passng 3 3-vecs, 
specified as column- or row- vectors, by using the colVecs or rowVecs
keyword arguments, respectively:
 
m=Mat3(colVecs=[v1,v2,v3])
or
m=Mat3(rowVecs=[v1,v2,v3])
__mul__(s, x)

Methods inherited from cdsMatrix.CDSMatrix_double:
__add__(self, *args, **kwargs) -> 'CDSMatrix< double >'
__getitem__(self, *args, **kwargs) -> 'double'
__iadd__(self, *args, **kwargs) -> 'CDSMatrix< double >'
__neg__(self, *args, **kwargs) -> 'CDSMatrix< double >'
__repr__(self, *args, **kwargs) -> 'String'
Return repr(self).
__rmul__(self, *args, **kwargs) -> 'CDSMatrix< double >'
__setitem__(self, *args, **kwargs) -> 'void'
__str__(self, *args, **kwargs) -> 'String'
Return str(self).
__sub__(self, *args, **kwargs) -> 'CDSMatrix< double >'
add(self, *args, **kwargs) -> 'void'
cols(self, *args, **kwargs) -> 'int'
fromList(s, l)
get(self, *args, **kwargs) -> 'double'
rawData(self, *args, **kwargs) -> 'CDSVector< double >'
resize(self, *args, **kwargs) -> 'void'
rows(self, *args, **kwargs) -> 'int'
scale(self, *args, **kwargs) -> 'void'
set(self, *args) -> 'void'
setDiag(self, *args) -> 'void'

Static methods inherited from cdsMatrix.CDSMatrix_double:
__swig_destroy__ = delete_CDSMatrix_double(...)

Data descriptors inherited from cdsMatrix.CDSMatrix_double:
__dict__

 
dictionary for instance variables (if defined)
__weakref__

 
list of weak references to the object (if defined)
thisown

 
The membership flag

 
class SymMat3(cdsMatrix.SymMatrix_double)
    SymMat3(a=0, b=0, c=0, d=0, e=0, f=0)
 

 
 
Method resolution order:
SymMat3
cdsMatrix.SymMatrix_double
builtins.object

Methods defined here:
__init__(s, a=0, b=0, c=0, d=0, e=0, f=0)
SymMat3 has a specialized constructor which allows lower triangular
elements to be enumerated as arguments. example:
m=SymMat3(m11,
          m12,m22,
          m13,m23,m33)

Methods inherited from cdsMatrix.SymMatrix_double:
__add__(self, *args, **kwargs) -> 'SymMatrix< double >'
__getitem__(self, *args, **kwargs) -> 'double'
__iadd__(self, *args, **kwargs) -> 'SymMatrix< double >'
__mul__(self, *args) -> 'CDSVector< double >'
__repr__(self, *args, **kwargs) -> 'String'
Return repr(self).
__rmul__(self, *args, **kwargs) -> 'SymMatrix< double >'
__setitem__(self, *args, **kwargs) -> 'void'
__str__(self, *args, **kwargs) -> 'String'
Return str(self).
__sub__(self, *args, **kwargs) -> 'SymMatrix< double >'
cols(self, *args, **kwargs) -> 'int'
rows(self, *args, **kwargs) -> 'int'
scale(self, *args, **kwargs) -> 'void'
set(self, *args) -> 'void'
setDiag(self, *args, **kwargs) -> 'void'

Static methods inherited from cdsMatrix.SymMatrix_double:
__swig_destroy__ = delete_SymMatrix_double(...)

Data descriptors inherited from cdsMatrix.SymMatrix_double:
__dict__

 
dictionary for instance variables (if defined)
__weakref__

 
list of weak references to the object (if defined)
thisown

 
The membership flag

 
Functions
       
outerProd(v1, v2)
randOrient()
Return a random orientation :math:`u`, which is 
performed in 
spherical polar coordinates- with the these variables sampled
uniformly: azimuthal angle :math:`  heta` in the range :math:`-\pi..\pi`, 
and the
cosine of the polar angle :math:`\phi` in the range -1..1. 
 
vec3.Vec3 is returned: :math:`(\cos(  heta)\sin(\phi),
                              \sin( heta)\sin(\phi),
                              \cos(\phi))`
randRot(deltaAngle=3.141592653589793)
Return a random rotation by an amount up to deltaAngle.
This is accomplished by first choosing an random direction using 
randOrient(), and the choosing a random rotation amount 0..deltaAngle,
with the distribution 
 
   P(alpha) = 2/deltaAngle sin^2(alpha / 2)
 
such that the distributions of rotations are biased away from zero 
rotation. 
 
Reference: Rotation, Reflection, and Frame Changes
    Orthogonal tensors in computational engineering mechanics
                    R M Brannon
IOP Publishing (2018)
 
DOI: 10.1088/978-0-7503-1454-1
rotVector(uvec, angle)
uvec, angle) - return matrix corresponding to rotation about 
 3-vector uvec by angle (in radians).
 
R  =  c * I + (1-c) * uvec * uvec^T + s * crossMat(uvec)
 
where c = cos(angle), s = sin(angle), and crossMat(v) is the matrix 
associated with vector v s.t. crossMat(v) u = u X v.
rotationAmount(R)
given rotation matrix R, determine and return the magnitude of the
associated rotation, in radians.

 
Data
        pi = 3.141592653589793