42 Vec3d() { _v[0]=0.0; _v[1]=0.0; _v[2]=0.0;}
46 inline operator Vec3f()
const {
return Vec3f(static_cast<float>(_v[0]),static_cast<float>(_v[1]),static_cast<float>(_v[2]));}
48 Vec3d(value_type
x,value_type
y,value_type
z) { _v[0]=
x; _v[1]=
y; _v[2]=
z; }
62 if (_v[0]<v.
_v[0])
return true;
63 else if (_v[0]>v.
_v[0])
return false;
64 else if (_v[1]<v.
_v[1])
return true;
65 else if (_v[1]>v.
_v[1])
return false;
66 else return (_v[2]<v.
_v[2]);
69 inline value_type*
ptr() {
return _v; }
70 inline const value_type*
ptr()
const {
return _v; }
72 inline void set( value_type
x, value_type
y, value_type
z)
74 _v[0]=
x; _v[1]=
y; _v[2]=
z;
79 _v[0]=rhs.
_v[0]; _v[1]=rhs.
_v[1]; _v[2]=rhs.
_v[2];
85 inline value_type&
x() {
return _v[0]; }
86 inline value_type&
y() {
return _v[1]; }
87 inline value_type&
z() {
return _v[2]; }
89 inline value_type
x()
const {
return _v[0]; }
90 inline value_type
y()
const {
return _v[1]; }
91 inline value_type
z()
const {
return _v[2]; }
101 return _v[0]*rhs.
_v[0]+_v[1]*rhs.
_v[1]+_v[2]*rhs.
_v[2];
107 return Vec3d(_v[1]*rhs.
_v[2]-_v[2]*rhs.
_v[1],
108 _v[2]*rhs.
_v[0]-_v[0]*rhs.
_v[2] ,
109 _v[0]*rhs.
_v[1]-_v[1]*rhs.
_v[0]);
115 return Vec3d(_v[0]*rhs, _v[1]*rhs, _v[2]*rhs);
130 return Vec3d(_v[0]/rhs, _v[1]/rhs, _v[2]/rhs);
145 return Vec3d(_v[0]+rhs.
_v[0], _v[1]+rhs.
_v[1], _v[2]+rhs.
_v[2]);
162 return Vec3d(_v[0]-rhs.
_v[0], _v[1]-rhs.
_v[1], _v[2]-rhs.
_v[2]);
177 return Vec3d (-_v[0], -_v[1], -_v[2]);
183 return sqrt( _v[0]*_v[0] + _v[1]*_v[1] + _v[2]*_v[2] );
189 return _v[0]*_v[0] + _v[1]*_v[1] + _v[2]*_v[2];
201 value_type inv = 1.0/norm;
214 return Vec3d(lhs[0]*rhs[0], lhs[1]*rhs[1], lhs[2]*rhs[2]);
220 return Vec3d(lhs[0]/rhs[0], lhs[1]/rhs[1], lhs[2]/rhs[2]);
const Vec3d operator-() const
Vec3d(value_type x, value_type y, value_type z)
Vec3d(const Vec2d &v2, value_type zz)
bool operator!=(const Vec3d &v) const
const Vec3d operator^(const Vec3d &rhs) const
Vec3d & operator/=(value_type rhs)
bool operator==(const Vec3d &v) const
Vec2d componentDivide(const Vec2d &lhs, const Vec2d &rhs)
value_type & operator[](int i)
value_type length2() const
Vec3d & operator-=(const Vec3d &rhs)
void set(value_type x, value_type y, value_type z)
const value_type * ptr() const
value_type operator*(const Vec3d &rhs) const
Vec3d & operator+=(const Vec3d &rhs)
const Vec3d operator/(value_type rhs) const
bool operator<(const Vec3d &v) const
const Vec3d operator+(const Vec3d &rhs) const
Vec3d & operator*=(value_type rhs)
value_type length() const
Vec2d componentMultiply(const Vec2d &lhs, const Vec2d &rhs)
void set(const Vec3d &rhs)