CMathLib Class Reference

Mathematical functions. More...

#include <util.h>

List of all members.

Static Public Member Functions

static double calcDotProduct (double firstVector[], double secondVector[], int size)
 Calculates dot product of two double vectors of the stated size.
static void calcMatrixResult (double matrix[], double vector[], int rows, int columns, double resultVector[])
 Calculates vector-matrix product.
static void getRotationFromMatrix (CMatrix &mat, CVec &axis, float &angle)
 Transforms homogenous matrix into axis-angle representation.
static void transposeMatrix (double *matrix, double *resultMatrix, int size)
 Transposes a matrix.
static void multiplyMatrices (double *firstMatrix, double *secondMatrix, int firstRows, int firstColumns, int secondColumns, double *resultMatrix)
 Multiplies two matrices.
static void quaternionFromMatrix (CMatrix &mat, CVec &quaternion)
 Transforms a homogenous matrix into quaternion representation.
static void matrixFromQuaternion (CVec &quaternion, CMatrix &matrix)
 Transforms a quaternion into homogenous matrix representation.
static void getMatrixFromRotation (CMatrix &mat, CVec &axis, float angle)
 Transforms axis-angle representation into homogenous matrix representation.
static void getOrientation (CMatrix &mat, CVec &first, CVec &second)
 Transforms homogenous matrix into Euler angle (YZX) representation (two solutions).
static void getRotation (CMatrix &mat, CVec &vec)
 ransforms Euler angle (YZX) representation into homogenous matrix representation
static void getRotation (CMatrix &mat, float x, float y, float z)
 Transforms Euler angle (YZX) representation into homogenous matrix representation.
static void calcAngles (float leg1, float leg2, float x, float y, float &first, float &second)
 Calculates inverse kinematics of a standard two link leg.


Detailed Description

Mathematical functions.


Member Function Documentation

double CMathLib::calcDotProduct ( double  firstVector[],
double  secondVector[],
int  size 
) [static]

Calculates dot product of two double vectors of the stated size.

void CMathLib::calcMatrixResult ( double  matrix[],
double  vector[],
int  rows,
int  columns,
double  resultVector[] 
) [static]

Calculates vector-matrix product.

Parameters:
resultVector Has to be allocated

void CMathLib::getRotationFromMatrix ( CMatrix mat,
CVec axis,
float &  angle 
) [static]

Transforms homogenous matrix into axis-angle representation.

void CMathLib::transposeMatrix ( double *  matrix,
double *  resultMatrix,
int  size 
) [static]

Transposes a matrix.

Set resultMatrix to matrix if you want to transpose the matrix

Parameters:
resultMatrix Has to be allocated

void CMathLib::multiplyMatrices ( double *  firstMatrix,
double *  secondMatrix,
int  firstRows,
int  firstColumns,
int  secondColumns,
double *  resultMatrix 
) [static]

Multiplies two matrices.

Parameters:
resultMatrix Has to be allocated

void CMathLib::quaternionFromMatrix ( CMatrix mat,
CVec quaternion 
) [static]

Transforms a homogenous matrix into quaternion representation.

Parameters:
quaternion XYZ is the rotation axis part, W the angle part

void CMathLib::matrixFromQuaternion ( CVec quaternion,
CMatrix matrix 
) [static]

Transforms a quaternion into homogenous matrix representation.

void CMathLib::getMatrixFromRotation ( CMatrix mat,
CVec axis,
float  angle 
) [static]

Transforms axis-angle representation into homogenous matrix representation.

void CMathLib::getOrientation ( CMatrix mat,
CVec first,
CVec second 
) [static]

Transforms homogenous matrix into Euler angle (YZX) representation (two solutions).

void CMathLib::getRotation ( CMatrix mat,
CVec vec 
) [static]

ransforms Euler angle (YZX) representation into homogenous matrix representation

See also:
getRotation

void CMathLib::getRotation ( CMatrix mat,
float  x,
float  y,
float  z 
) [static]

Transforms Euler angle (YZX) representation into homogenous matrix representation.

void CMathLib::calcAngles ( float  leg1,
float  leg2,
float  x,
float  y,
float &  first,
float &  second 
) [static]

Calculates inverse kinematics of a standard two link leg.

Parameters:
leg1 Length of leg connected to base
leg2 Length of leg connected to hand
x Cartesian x position of hand
y Cartesian y position of hand
first Angle between base and leg1
second Angle between leg1 and leg2 (elbow)


The documentation for this class was generated from the following files:
Generated on Mon Apr 21 23:27:44 2008 for BioloidControl by  doxygen 1.5.2