24 #ifndef _HUGIN_MATH_VECTOR3_H_
25 #define _HUGIN_MATH_VECTOR3_H_
32 #define EPSILON 0.0000001
55 Vector3(
double a,
double b,
double c): x(a), y(b), z(c) {}
70 void Set(
double a,
double b,
double c);
73 inline bool operator== (
const Vector3& v)
const
75 return (v.
x==x && v.
y==y && v.
z==z);
79 inline bool operator!= (
const Vector3& v )
const
88 bool IsNearlyZero()
const;
91 bool IsNearlyEqual(
const Vector3& v)
const;
96 return Vector3( v.
x * Scale, v.
y * Scale, v.
z * Scale );
114 return Vector3( x * Scale, y * Scale, z * Scale );
154 Vector3 operator/=(
double Scale );
160 double NormSquared()
const;
165 return Vector3( v.
z*y - v.
y*z, v.
x*z - v.
z*x, v.
y*x - v.
x*y);
171 return x*v.
x + y*v.
y + z*v.
z;
185 s <<
"[ " << v.
x <<
", " << v.
y <<
", " << v.
z <<
" ]";
Vector3 operator-=(const Vector3 &v)
operator -=
double Dot(const Vector3 &v) const
dot product
Vector3 operator*=(double Scale)
double multiply
Vector3()
default constructor
Vector3(const Vector3 &v)
copy contructor
Vector3 operator+=(const Vector3 &v)
operator +=
friend Vector3 operator*(double Scale, const Vector3 &v)
operator *
Vector3 operator-() const
Unary minus.
Vector3(double a, double b, double c)
constructor with initialisation
Vector3 Cross(const Vector3 &v) const
cross product
hugin_utils::FDiff2D operator/(const hugin_utils::FDiff2D &lhs, double val)
Vector3 operator*(double Scale) const
operator *(double)
std::ostream & operator<<(std::ostream &o, const hugin_utils::TDiff2D< T > &d)
Vector3 operator-(const Vector3 &v) const
operator -
general : Vector3 is a class for handling 3D Vectors manipulation.
Vector3 operator+(const Vector3 &v) const
operator +
double x
x,y,z coordinates, 0 at the initialisation