|
ADBLib
0.5
A simple library for rapid robot code development
|
#include <Vector3D.h>
Public Member Functions | |
| Vector3D () | |
| Constructor. Sets y and z to 0, and x to 1. More... | |
| Vector3D (double newX, double newY, double newZ) | |
| Constructor. Lets you set initial component values. More... | |
| void | normalize () |
| Normalizes the vector, preserving the direction but setting magnitude to 1. More... | |
| double | mag () const |
| Returns the magnitude of the vector. More... | |
| void | setMag (double newMag) |
| Sets the magnitude of the vector. More... | |
| double | getADelt (Vector3D vec) const |
| Gets the angle between two vectors. More... | |
| void | rotateX (double rad) |
| Rotates the vector about the X axis. More... | |
| void | rotateY (double rad) |
| Rotates the vector about the Y axis. More... | |
| void | rotateZ (double rad) |
| Rotates the vector about the Z axis. More... | |
| Vector3D | operator+ (const Vector3D &vec) const |
| Standard vector addition. More... | |
| Vector3D | operator- (const Vector3D &vec) const |
| Standard vector subtraction. More... | |
| double | operator* (const Vector3D &vec) const |
| Vector dot product. More... | |
| Vector3D | operator* (const double &num) const |
| Vector3D | operator% (const Vector3D &vec) const |
| Vector cross product. More... | |
| void | setX (double newX) |
| Sets X component. More... | |
| void | setY (double newY) |
| Sets Y component. More... | |
| void | setZ (double newZ) |
| Sets new Z component. More... | |
| double | getX () const |
| Returns the X component. More... | |
| double | getY () const |
| Returns the Y component. More... | |
| double | getZ () const |
| Retusn the Z component. More... | |
| double | getAngleX () const |
| Returns the angle to the X axis. More... | |
| double | getAngleY () const |
| Returns the angle to the Y axis. More... | |
| double | getAngleZ () const |
| Returns the angle to the Z axis. More... | |
| Matrix | toMatrix () const |
| Converts this vector to a 3x1 matrix. More... | |
| void | setMatrix (Matrix mat) |
| Sets the components of this vector based on a 3x1 matrix. More... | |
Protected Attributes | |
| double | xComp |
| double | yComp |
| double | zComp |
| ADBLib::Vector3D::Vector3D | ( | ) |
Constructor. Sets y and z to 0, and x to 1.
| ADBLib::Vector3D::Vector3D | ( | double | newX, |
| double | newY, | ||
| double | newZ | ||
| ) |
Constructor. Lets you set initial component values.
| newX | X component |
| newY | Y component |
| newZ | Z component |
| double ADBLib::Vector3D::getADelt | ( | Vector3D | vec | ) | const |
Gets the angle between two vectors.
| vec | The second vector. |

| double ADBLib::Vector3D::getAngleX | ( | ) | const |
Returns the angle to the X axis.
| double ADBLib::Vector3D::getAngleY | ( | ) | const |
Returns the angle to the Y axis.
| double ADBLib::Vector3D::getAngleZ | ( | ) | const |
Returns the angle to the Z axis.
| double ADBLib::Vector3D::getX | ( | ) | const |
Returns the X component.
| double ADBLib::Vector3D::getY | ( | ) | const |
Returns the Y component.
| double ADBLib::Vector3D::getZ | ( | ) | const |
Retusn the Z component.
| double ADBLib::Vector3D::mag | ( | ) | const |
Returns the magnitude of the vector.

| void ADBLib::Vector3D::normalize | ( | ) |
Normalizes the vector, preserving the direction but setting magnitude to 1.
Vector cross product.
| double ADBLib::Vector3D::operator* | ( | const Vector3D & | vec | ) | const |
Vector dot product.
| Vector3D ADBLib::Vector3D::operator* | ( | const double & | num | ) | const |
| void ADBLib::Vector3D::rotateX | ( | double | rad | ) |
Rotates the vector about the X axis.
| rad | Angle of rotation in radians. |

| void ADBLib::Vector3D::rotateY | ( | double | rad | ) |
Rotates the vector about the Y axis.
| rad | Angle of rotation in radians. |

| void ADBLib::Vector3D::rotateZ | ( | double | rad | ) |
Rotates the vector about the Z axis.
| rad | Angle of rotation in radians. |

| void ADBLib::Vector3D::setMag | ( | double | newMag | ) |
Sets the magnitude of the vector.
| newMag | New magnitude. |
| void ADBLib::Vector3D::setMatrix | ( | Matrix | mat | ) |
Sets the components of this vector based on a 3x1 matrix.
| mat | A 3x1 matrix of vector components in order x,y,z |

| void ADBLib::Vector3D::setX | ( | double | newX | ) |
Sets X component.
| newX | New X component |
| void ADBLib::Vector3D::setY | ( | double | newY | ) |
Sets Y component.
| newY | New Y component. |
| void ADBLib::Vector3D::setZ | ( | double | newZ | ) |
Sets new Z component.
| newZ | New Z component. |
| Matrix ADBLib::Vector3D::toMatrix | ( | ) | const |
Converts this vector to a 3x1 matrix.

|
protected |
|
protected |
|
protected |