This class represents a three-dimensional vector. More...
#include <Vector3.h>
Public Member Functions | |
double | angleTo (const Vector3 &other) const |
Vector3 | cross (const Vector3 &other) const |
Three-dimensional vector (cross) product. | |
double | distance (const Vector3 &other) const |
double | distanceXY (const Vector3 &other) const |
double | dot (const Vector3 &other) const |
dot product | |
double | norm () const |
double | norm_sq () const |
Vector3 & | normalize () |
normalizes this vector, so that it has norm=1.0 | |
Vector3 | normalized () const |
const float & | operator() (unsigned int i) const |
float & | operator() (unsigned int i) |
Vector3 | operator* (float x) const |
void | operator*= (float x) |
Vector3 | operator+ (const Vector3 &other) const |
void | operator+= (const Vector3 &other) |
Vector3 | operator- () const |
Vector3 | operator- (const Vector3 &other) const |
void | operator-= (const Vector3 &other) |
void | operator/= (float x) |
Vector3 & | operator= (const Vector3 &other) |
Assignment operator. | |
bool | operator== (const Vector3 &other) const |
float & | pitch () |
const float & | pitch () const |
std::istream & | read (std::istream &s) |
std::istream & | readBinary (std::istream &s) |
float & | roll () |
const float & | roll () const |
Vector3 & | rotate_IP (double roll, double pitch, double yaw) |
Vector3 () | |
Default constructor. | |
Vector3 (const Vector3 &other) | |
Copy constructor. | |
Vector3 (float x, float y, float z) | |
Constructor. | |
std::ostream & | write (std::ostream &s) const |
std::ostream & | writeBinary (std::ostream &s) const |
float & | x () |
const float & | x () const |
float & | y () |
const float & | y () const |
float & | yaw () |
const float & | yaw () const |
float & | z () |
const float & | z () const |
Protected Attributes | |
float | data [3] |
This class represents a three-dimensional vector.
The three-dimensional vector can be used to represent a translation in three-dimensional space or to represent the attitude of an object using Euler angle.
octomath::Vector3::Vector3 | ( | ) | [inline] |
octomath::Vector3::Vector3 | ( | const Vector3 & | other | ) | [inline] |
octomath::Vector3::Vector3 | ( | float | x, |
float | y, | ||
float | z | ||
) | [inline] |
double octomath::Vector3::angleTo | ( | const Vector3 & | other | ) | const [inline] |
Vector3 octomath::Vector3::cross | ( | const Vector3 & | other | ) | const [inline] |
double octomath::Vector3::distance | ( | const Vector3 & | other | ) | const [inline] |
double octomath::Vector3::distanceXY | ( | const Vector3 & | other | ) | const [inline] |
double octomath::Vector3::dot | ( | const Vector3 & | other | ) | const [inline] |
double octomath::Vector3::norm | ( | ) | const [inline] |
double octomath::Vector3::norm_sq | ( | ) | const [inline] |
Vector3& octomath::Vector3::normalize | ( | ) | [inline] |
Vector3 octomath::Vector3::normalized | ( | ) | const [inline] |
const float& octomath::Vector3::operator() | ( | unsigned int | i | ) | const [inline] |
float& octomath::Vector3::operator() | ( | unsigned int | i | ) | [inline] |
Vector3 octomath::Vector3::operator* | ( | float | x | ) | const [inline] |
void octomath::Vector3::operator+= | ( | const Vector3 & | other | ) | [inline] |
void octomath::Vector3::operator-= | ( | const Vector3 & | other | ) | [inline] |
bool octomath::Vector3::operator== | ( | const Vector3 & | other | ) | const [inline] |
float& octomath::Vector3::pitch | ( | ) | [inline] |
const float& octomath::Vector3::pitch | ( | ) | const [inline] |
std::istream & octomath::Vector3::read | ( | std::istream & | s | ) |
Definition at line 69 of file Vector3.cpp.
std::istream & octomath::Vector3::readBinary | ( | std::istream & | s | ) |
Definition at line 87 of file Vector3.cpp.
float& octomath::Vector3::roll | ( | ) | [inline] |
const float& octomath::Vector3::roll | ( | ) | const [inline] |
Vector3 & octomath::Vector3::rotate_IP | ( | double | roll, |
double | pitch, | ||
double | yaw | ||
) |
Definition at line 41 of file Vector3.cpp.
std::ostream & octomath::Vector3::write | ( | std::ostream & | s | ) | const |
Definition at line 78 of file Vector3.cpp.
std::ostream & octomath::Vector3::writeBinary | ( | std::ostream & | s | ) | const |
Definition at line 99 of file Vector3.cpp.
float& octomath::Vector3::x | ( | ) | [inline] |
const float& octomath::Vector3::x | ( | ) | const [inline] |
float& octomath::Vector3::y | ( | ) | [inline] |
const float& octomath::Vector3::y | ( | ) | const [inline] |
float& octomath::Vector3::yaw | ( | ) | [inline] |
const float& octomath::Vector3::yaw | ( | ) | const [inline] |
float& octomath::Vector3::z | ( | ) | [inline] |
const float& octomath::Vector3::z | ( | ) | const [inline] |
float octomath::Vector3::data[3] [protected] |