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

Vector3D

Three dimensional vectors having x, y and z components.
Vectors can use many of the operators that you can use with more basic types. For example:
Assignment:
Vector3D vec1(1,2,3);
Vector3D vec2();
vec2 = vec1; // Set vec2 to the same values as used by vec1
Test for equality or inequality:
if( vec1 == vec2){
    // Both vectors are identical
}
if( vec1 != vec2){
    // The vectors are not identical
}
Addition:
vec3 = vec1 + vec2; // Add two vectors and store in a third
vec2 += vec1; // vec2 = vec2 + vec1
Subtraction:
vec3 = vec1 - vec2; // Subtract two vectors and store in a third
vec2 -= vec1; // vec2 = vec2 - vec1
Scaling:
vec2 = vec1 * 3.5; // Multiply each component of vec1 and store in vec2
vec2 *= 5; // Multiply each component of vec2 and store back in vec2

 

Method

 

Valid XHTML 1.0 Transitional