17 #ifndef _GAZEBO_VECTOR3_HH_
18 #define _GAZEBO_VECTOR3_HH_
23 #include <ignition/math/Vector3.hh>
63 public:
Vector3(
const double &_x,
const double &_y,
const double &_z);
67 public:
Vector3(
const ignition::math::Vector3d &_v);
78 public:
double GetSum()
const;
83 public:
double Distance(
const Vector3 &_pt)
const;
90 public:
double Distance(
double _x,
double _y,
double _z)
const;
94 public:
double GetLength()
const;
98 public:
double GetSquaredLength()
const;
110 public:
Vector3 GetRounded()
const;
116 public:
inline void Set(
double _x = 0,
double _y = 0 ,
double _z = 0)
129 public:
double Dot(
const Vector3 &_pt)
const;
133 public:
Vector3 GetAbs()
const;
137 public:
Vector3 GetPerpendicular()
const;
151 public:
double GetDistToLine(
const Vector3 &_pt1,
const Vector3 &_pt2);
156 public:
void SetToMax(
const Vector3 &_v);
161 public:
void SetToMin(
const Vector3 &_v);
165 public:
double GetMax()
const;
169 public:
double GetMin()
const;
173 public: ignition::math::Vector3d Ign()
const;
178 public:
Vector3 &operator=(
const ignition::math::Vector3d &_v);
188 public:
Vector3 &operator =(
double _value);
203 return Vector3(-this->x, -this->y, -this->z);
235 public:
const Vector3 operator/(
double _v)
const;
240 public:
const Vector3 &operator/=(
double _v);
259 {
return Vector3(_v.
x * _s, _v.
y * _s, _v.
z * _s); }
264 public:
Vector3 operator*(
double _v)
const;
269 public:
const Vector3 &operator*=(
double _v);
275 public:
bool operator ==(
const Vector3 &_pt)
const;
281 public:
bool operator!=(
const Vector3 &_v)
const;
284 public:
bool IsFinite()
const;
289 if (!std::isfinite(this->x))
291 if (!std::isfinite(this->y))
293 if (!std::isfinite(this->z))
298 public:
double operator[](
unsigned int index)
const;
302 public:
void Round(
int _precision);
308 public:
bool Equal(
const Vector3 &_v)
const;
339 _in.setf(std::ios_base::skipws);
340 _in >> _pt.
x >> _pt.
y >> _pt.
z;
double x
X location.
Definition: Vector3.hh:311
double y
Y location.
Definition: Vector3.hh:314
static const Vector3 UnitY
math::Vector3(0, 1, 0)
Definition: Vector3.hh:51
The Vector3 class represents the generic vector containing 3 elements.
Definition: Vector3.hh:39
friend std::istream & operator>>(std::istream &_in, gazebo::math::Vector3 &_pt)
Stream extraction operator.
Definition: Vector3.hh:335
void Correct()
Corrects any nan values.
Definition: Vector3.hh:287
double z
Z location.
Definition: Vector3.hh:317
friend std::ostream & operator<<(std::ostream &_out, const gazebo::math::Vector3 &_pt)
Stream insertion operator.
Definition: Vector3.hh:323
static const Vector3 UnitZ
math::Vector3(0, 0, 1)
Definition: Vector3.hh:54
Vector3 operator-() const
Negation operator.
Definition: Vector3.hh:201
static const Vector3 One
math::Vector3(1, 1, 1)
Definition: Vector3.hh:45
T precision(const T &_a, const unsigned int &_precision)
get value at a specified precision
Definition: Helpers.hh:182
void Set(double _x=0, double _y=0, double _z=0)
Set the contents of the vector.
Definition: Vector3.hh:116
static const Vector3 UnitX
math::Vector3(1, 0, 0)
Definition: Vector3.hh:48
friend Vector3 operator*(double _s, const Vector3 &_v)
Multiplication operators.
Definition: Vector3.hh:257
static const Vector3 Zero
math::Vector3(0, 0, 0)
Definition: Vector3.hh:42
Vector3 operator-(const Vector3 &_pt) const
Subtraction operators.
Definition: Vector3.hh:209