WebbotLib AVR library
WebbotLib It just does it
  C++ documentation  C documentation

transform

Multiplies the specified vector by the matrix to return a new transformed vector.
Syntax
Matrix3D. transform(vector)
 
Parameters
TypeNameDescription
'vector'
A vector
Returns
Vector3D
Example
Create a vector:
Vector3D vecIn( 1,0,0 );
Create a matrix that represent a rotation around the X axis:
Matrix3D mat;
mat.setRotateX(3.142);
Create another vector to hold the result:
Vector3D vecOut = mat.transform(vecIn);
Alternatively: if you will no longer require the original vecIn vector then you can overwrite it with the result to minimise the number of different variables you are using:
vecIn = mat.transform(vecIn);

 

 

Valid XHTML 1.0 Transitional