Go to the documentation of this file.
   34 #ifndef OCTOMATH_VECTOR3_H 
   35 #define OCTOMATH_VECTOR3_H 
  112                      z()*other.
x() - 
x()*other.
z(),
 
  113                      x()*other.
y() - 
y()*other.
x());
 
  119       return x()*other.
x() + 
y()*other.
y() + 
z()*other.
z();
 
  146     inline const float& 
x()
 const  
  151     inline const float& 
y()
 const  
  156     inline const float& 
z()
 const  
  176     inline const float& 
roll()
 const  
  186     inline const float& 
yaw()
 const  
  194       result(0) = -
data[0];
 
  195       result(1) = -
data[1];
 
  196       result(2) = -
data[2];
 
  203       result(0) += other(0);
 
  204       result(1) += other(1);
 
  205       result(2) += other(2);
 
  220       result(0) -= other(0);
 
  221       result(1) -= other(1);
 
  222       result(2) -= other(2);
 
  252       for (
unsigned int i=0; i<3; i++) {
 
  253         if (
operator()(i) != other(i)) 
 
  260       for (
unsigned int i=0; i<3; i++){
 
  261         if (
operator()(i) < other(i))
 
  263         else if (
operator()(i) == other(i))
 
  277       return (
x()*
x() + 
y()*
y() + 
z()*
z());
 
  284         *
this /= (float) len;
 
  296       double dot_prod = this->
dot(other);
 
  297       double len1 = this->
norm();
 
  298       double len2 = other.
norm();
 
  299       return acos(dot_prod / (len1*len2));
 
  304       double dist_x = 
x() - other.
x();
 
  305       double dist_y = 
y() - other.
y();
 
  306       double dist_z = 
z() - other.
z();
 
  307       return sqrt(dist_x*dist_x + dist_y*dist_y + dist_z*dist_z);
 
  311       double dist_x = 
x() - other.
x();
 
  312       double dist_y = 
y() - other.
y();
 
  313       return sqrt(dist_x*dist_x + dist_y*dist_y);
 
  319     std::istream& 
read(std::istream &s);
 
  320     std::ostream& 
write(std::ostream &s) 
const;
 
  
Vector3()
Default constructor.
Vector3 & operator=(const Vector3 &other)
Assignment operator.
const float & yaw() const
std::ostream & writeBinary(std::ostream &s) const
Vector3 operator+(const Vector3 &other) const
Vector3(const Vector3 &other)
Copy constructor.
void operator-=(const Vector3 &other)
std::ostream & operator<<(std::ostream &s, const Pose6D &p)
user friendly output in format (x y z, u x y z) which is (translation, rotation)
bool operator==(const Vector3 &other) const
Vector3 & rotate_IP(double roll, double pitch, double yaw)
const float & pitch() const
Vector3 & normalize()
normalizes this vector, so that it has norm=1.0
double distanceXY(const Vector3 &other) const
This class represents a three-dimensional vector.
double dot(const Vector3 &other) const
dot product
std::istream & read(std::istream &s)
Vector3(float x, float y, float z)
Constructor.
Vector3 operator*(float x) const
std::istream & readBinary(std::istream &s)
void operator+=(const Vector3 &other)
Vector3 operator-() const
std::ostream & write(std::ostream &s) const
double angleTo(const Vector3 &other) const
Vector3 normalized() const
Vector3 cross(const Vector3 &other) const
Three-dimensional vector (cross) product.
double distance(const Vector3 &other) const
const float & operator()(unsigned int i) const
bool operator<(const Vector3 &other) const
const float & roll() const
octomap
Author(s): Kai M. Wurm 
, Armin Hornung 
autogenerated on Mon Apr 21 2025 02:39:48