34 Vector3(
const double x_,
const double y_,
const double z_);
54 return (valX==0 && valY==0 && valZ==0);
61 void xyz(
double& x_,
double& y_,
double& z_)
const
81 inline double x()
const
90 inline double y()
const
100 inline double z()
const
111 void set(
const double x_,
const double y_,
const double z_);
163 if(valX>=valY && valX>=valZ)
return valX;
164 if(valY>=valZ)
return valY;
222 void addOwnCoords(
double& x,
double& y,
double& z)
const
229 Vector3& operator+=(
const Vector3& other);
230 Vector3& operator-=(
const Vector3& other);
231 Vector3& operator/=(
double div);
232 Vector3& operator*=(
double mul);
247 inline std::ostream &operator<<(std::ostream &stream,
const Vector3& vec)
249 stream <<
"Vector3: "<<vec.x()<<
", "<<vec.y()<<
", "<<vec.z();
259 double x=vec0.
y() * vec1.
z() - vec0.
z() * vec1.
y();
260 double y=vec0.
z() * vec1.
x() - vec0.
x() * vec1.
z();
261 double z=vec0.
x() * vec1.
y() - vec0.
y() * vec1.
x();
277 inline Vector3 operator*(
double d,
const Vector3& vec)
279 return Vector3(d*vec.x(),d*vec.y(),d*vec.z());
283 inline Vector3 operator+(
const Vector3& vec0,
const Vector3& vec1)
285 return Vector3(vec0.x()+vec1.x(), vec0.y()+vec1.y() , vec0.z()+vec1.z());
288 inline Vector3 operator-(
const Vector3& vec0,
const Vector3& vec1)
290 return Vector3(vec0.x()-vec1.x(), vec0.y()-vec1.y() , vec0.z()-vec1.z());
3D Vector
Definition: Vector3.h:27
double z() const
Get the z-value.
Definition: Vector3.h:100
void set(const double x_, const double y_, const double z_)
Set x,y,z.
double sqLength() const
Get the squared length of the vector.
double operator*(const Vector3 &other) const
Scalar product.
double getCartesian(int i) const
Get component i.
Vector3 & operator=(const Vector3 &other)
Assignment operator.
Definition: Vector3.h:213
Vector3(const Vector3 &v_)
Copy constructor.
double x() const
Get the x-value.
Definition: Vector3.h:81
void add(const Vector3 &other)
Add a Vector3 to the present one.
Definition: Vector3.h:117
Vector3(const double x_, const double y_, const double z_)
Constructor.
double getMaxComponent() const
Get max component.
Definition: Vector3.h:161
void reset()
reset
Definition: Vector3.h:71
Vector3()
Default constructor.
double getMaxAbsComponent() const
Get max absolute component.
int getMaxAbsIndex() const
Get max index.
Vector3 operator*(double val) const
Multiply by a scalar value.
Vector3 operator/(double val) const
Divide by a scalar value.
bool isDegenerate() const
isDegenerate
Definition: Vector3.h:52
void xyz(double &x_, double &y_, double &z_) const
Get x,y,z.
Definition: Vector3.h:61
double length() const
Get the length of the vector.
double y() const
Get the y-value.
Definition: Vector3.h:90
Vector3 normalize(const Vector3 &other)
Normalize.
Vector3 crossProduct(const Vector3 &vec0, const Vector3 &vec1)
Cross product.
Definition: Vector3.h:256