OpenSim::Mtx Class Reference

A class for performing vector and matrix operations. More...

#include <Mtx.h>

List of all members.

Static Public Member Functions

static double Angle (const SimTK::Vec3 &aV1, const SimTK::Vec3 &aV2)
 Find the angle between two vectors: theta = acos( aV1*aV2/(|aV1|*|aV2|)).
static double Normalize (int aN, const SimTK::Vec3 &aV, SimTK::Vec3 &rV)
 Normalize a vector.
static double Magnitude (int aN, const SimTK::Vec3 &aV)
 Compute the magnitude of a vector.
static double DotProduct (int aN, const SimTK::Vec3 &aV1, const SimTK::Vec3 &aV2)
 Compute the dot product of two vectors.
static void CrossProduct (const SimTK::Vec3 &aV1, const SimTK::Vec3 &aV2, SimTK::Vec3 &aV)
 Compute the cross product of two vectors.
static void PerpendicularUnitVector (const SimTK::Vec3 &aV, SimTK::Vec3 &rV)
 Get a unit vector that is perpendicular to a specified vector.
static void Interpolate (int aN, double aT1, double *aY1, double aT2, double *aY2, double t, double *aY)
static double Interpolate (double aT1, double aY1, double aT2, double aY2, double t)
static void Translate (double aX, double aY, double aZ, const double aP[3], double rP[3])
static void Rotate (int aXYZ, double aRadians, const double aP[3], double rP[3])
static void Rotate (const double aAxis[3], double aRadians, const double aP[3], double rP[3])
static void RotateDeg (int aXYZ, double aDegrees, const double aP[3], double rP[3])
static void RotateDeg (const double aAxis[3], double aDegrees, const double aP[3], double rP[3])
static int Identity (int aNR, double *rI)
static int Add (int aNR, int aNC, const double *aM1, const double *aM2, double *aM)
static int Subtract (int aNR, int aNC, const double *aM1, const double *aM2, double *aM)
static int Multiply (int aNR, int aNC, const double *aM, double aScalar, double *rM)
static int Multiply (int aNR1, int aNCR, int aNC2, const double *aM1, const double *aM2, double *aM)
static int Invert (int aN, const double *aM, double *aMInv)
static int Transpose (int aNR, int aNC, const double *aM, double *aMT)
static void Print (int aNR, int aNC, const double *aM, int aPrecision=8)
static int FindIndex (int aStartIndex, double aTime, int aNT, double *aT)
static int FindIndexLess (int aNX, double *aX, double aValue)
static int FindIndexGreater (int aNX, double *aX, double aValue)
static int ComputeIndex (int i2, int n1, int i1)
static int ComputeIndex (int i3, int n2, int i2, int n1, int i1)
static void GetDim3 (int n3, int n2, int n1, int i2, int i1, double *m, double *a)
static void SetDim3 (int n3, int n2, int n1, int i2, int i1, double *m, double *a)
static int EnsureWorkSpaceCapacity (int aN)
static int EnsurePointerSpaceCapacity (int aN)
static void FreeWorkAndPointerSpaces ()

Detailed Description

A class for performing vector and matrix operations.

Most all the methods in this class are static.


Member Function Documentation

static int OpenSim::Mtx::Add ( int  aNR,
int  aNC,
const double *  aM1,
const double *  aM2,
double *  aM 
) [static]
static double OpenSim::Mtx::Angle ( const SimTK::Vec3 &  aV1,
const SimTK::Vec3 &  aV2 
) [inline, static]

Find the angle between two vectors: theta = acos( aV1*aV2/(|aV1|*|aV2|)).

Parameters:
aV1 Vector 1.
aV2 Vector 2.
Returns:
Angle between two vectors in radians.
static int OpenSim::Mtx::ComputeIndex ( int  i3,
int  n2,
int  i2,
int  n1,
int  i1 
) [static]
static int OpenSim::Mtx::ComputeIndex ( int  i2,
int  n1,
int  i1 
) [static]
static void OpenSim::Mtx::CrossProduct ( const SimTK::Vec3 &  aV1,
const SimTK::Vec3 &  aV2,
SimTK::Vec3 &  aV 
) [inline, static]

Compute the cross product of two vectors.

If the arguments are not valid (aR=aS=NULL), -1 is returned.

static double OpenSim::Mtx::DotProduct ( int  aN,
const SimTK::Vec3 &  aV1,
const SimTK::Vec3 &  aV2 
) [inline, static]

Compute the dot product of two vectors.

If the arguments are not valid (aV1=aV2=NULL), 0.0 is returned.

static int OpenSim::Mtx::EnsurePointerSpaceCapacity ( int  aN  )  [static]
static int OpenSim::Mtx::EnsureWorkSpaceCapacity ( int  aN  )  [static]
static int OpenSim::Mtx::FindIndex ( int  aStartIndex,
double  aTime,
int  aNT,
double *  aT 
) [static]
static int OpenSim::Mtx::FindIndexGreater ( int  aNX,
double *  aX,
double  aValue 
) [static]
static int OpenSim::Mtx::FindIndexLess ( int  aNX,
double *  aX,
double  aValue 
) [static]
static void OpenSim::Mtx::FreeWorkAndPointerSpaces (  )  [static]
static void OpenSim::Mtx::GetDim3 ( int  n3,
int  n2,
int  n1,
int  i2,
int  i1,
double *  m,
double *  a 
) [static]
static int OpenSim::Mtx::Identity ( int  aNR,
double *  rI 
) [static]
static double OpenSim::Mtx::Interpolate ( double  aT1,
double  aY1,
double  aT2,
double  aY2,
double  t 
) [static]
static void OpenSim::Mtx::Interpolate ( int  aN,
double  aT1,
double *  aY1,
double  aT2,
double *  aY2,
double  t,
double *  aY 
) [static]
static int OpenSim::Mtx::Invert ( int  aN,
const double *  aM,
double *  aMInv 
) [static]
static double OpenSim::Mtx::Magnitude ( int  aN,
const SimTK::Vec3 &  aV 
) [inline, static]

Compute the magnitude of a vector.

Parameters:
aN Obsolete -- always pass as a "3".
aV Vector.
Returns:
Square root of the dot product aV*aV.
static int OpenSim::Mtx::Multiply ( int  aNR1,
int  aNCR,
int  aNC2,
const double *  aM1,
const double *  aM2,
double *  aM 
) [static]
static int OpenSim::Mtx::Multiply ( int  aNR,
int  aNC,
const double *  aM,
double  aScalar,
double *  rM 
) [static]
static double OpenSim::Mtx::Normalize ( int  aN,
const SimTK::Vec3 &  aV,
SimTK::Vec3 &  rV 
) [inline, static]

Normalize a vector.

If aV has a magnitude of zero, all elements of rV are set to 0.0. It is permissible for aV and rV to coincide in memory.

Parameters:
aN Obsolete -- always pass as a "3".
aV Vector to be normalized.
rV Result of the normalization.
Returns:
Magnitude of aV.
static void OpenSim::Mtx::PerpendicularUnitVector ( const SimTK::Vec3 &  aV,
SimTK::Vec3 &  rV 
) [inline, static]

Get a unit vector that is perpendicular to a specified vector.

The unit vector is arbitrary, in the sense that it is one of an infinite number of vectors that are perpendicular to the original specified vector.

Parameters:
aV Input vector.
rV Perpendicular unit vector.
static void OpenSim::Mtx::Print ( int  aNR,
int  aNC,
const double *  aM,
int  aPrecision = 8 
) [static]
static void OpenSim::Mtx::Rotate ( const double  aAxis[3],
double  aRadians,
const double  aP[3],
double  rP[3] 
) [static]
static void OpenSim::Mtx::Rotate ( int  aXYZ,
double  aRadians,
const double  aP[3],
double  rP[3] 
) [static]
static void OpenSim::Mtx::RotateDeg ( const double  aAxis[3],
double  aDegrees,
const double  aP[3],
double  rP[3] 
) [static]
static void OpenSim::Mtx::RotateDeg ( int  aXYZ,
double  aDegrees,
const double  aP[3],
double  rP[3] 
) [static]
static void OpenSim::Mtx::SetDim3 ( int  n3,
int  n2,
int  n1,
int  i2,
int  i1,
double *  m,
double *  a 
) [static]
static int OpenSim::Mtx::Subtract ( int  aNR,
int  aNC,
const double *  aM1,
const double *  aM2,
double *  aM 
) [static]
static void OpenSim::Mtx::Translate ( double  aX,
double  aY,
double  aZ,
const double  aP[3],
double  rP[3] 
) [static]
static int OpenSim::Mtx::Transpose ( int  aNR,
int  aNC,
const double *  aM,
double *  aMT 
) [static]

The documentation for this class was generated from the following file:

Generated on Mon Jun 11 13:03:17 2012 for OpenSim by  doxygen 1.6.1