52 setXYZ(u[0],u[1],u[2],normalization);
87 return u[0]*v[0] + u[1]*v[1] + u[2]*v[2];
92 return u[0]*v[0] + u[1]*v[1] + u[2]*v[2];
175 out << u[0] <<
" " << u[1] <<
" " << u[2];
194 throw std::runtime_error(
"Attempt to normalize a null 3D vector.") ;
void setXYZ(double x, double y, double z, bool normalization=true)
Writing X,Y and Z coordinates.
NVector3()
Default constructor (the default normalized vector is (1,0,0))
NVector3 & operator=(const NVector3 &u)
Assignment.
friend std::ostream & operator<<(std::ostream &out, const NVector3 &u)
Out stream override: prints the 3 normalized vector components.
Vector2 operator*(double r, const Vector2 &u)
Left multiplication by a real value.
double _n[3]
normalized vector