3D Geometrical calculations More...
#include <vector>
#include <cmath>
Go to the source code of this file.
Classes | |
class | Vector3D |
3D Mathematical vector More... | |
Functions | |
double | abs (Vector3D const &v) |
Norm of a vector. More... | |
Vector3D | operator+ (Vector3D const &v1, Vector3D const &v2) |
Term by term addition. More... | |
Vector3D | operator- (Vector3D const &v1, Vector3D const &v2) |
Term by term subtraction. More... | |
Vector3D | operator* (double d, Vector3D const &v) |
Scalar product. More... | |
Vector3D | operator* (Vector3D const &v, double d) |
Scalar product. More... | |
Vector3D | operator/ (Vector3D const &v, double d) |
Scalar division. More... | |
double | ScalarProd (Vector3D const &v1, Vector3D const &v2) |
Scalar product of two vectors. More... | |
double | CalcAngle (Vector3D const &v1, Vector3D const &v2) |
Returns the angle between two vectors (in radians) More... | |
double | Projection (Vector3D const &v1, Vector3D const &v2) |
Calculates the projection of one vector in the direction of the second. More... | |
Vector3D | RotateX (Vector3D const &v, double a) |
Rotates a 3D-vector around the X axis. More... | |
Vector3D | RotateY (Vector3D const &v, double a) |
Rotates a 3D-vector around the Y axis. More... | |
Vector3D | RotateZ (Vector3D const &v, double a) |
Rotates a 3D-vector around the Z axis. More... | |
Vector3D | Reflect (Vector3D const &v, Vector3D const &normal) |
Reflect vector. More... | |
double | distance (Vector3D const &v1, Vector3D const &v2) |
Calculates the distance between two vectors. More... | |
Vector3D | CrossProduct (Vector3D const &v1, Vector3D const &v2) |
Returns the cross product of two vectors. More... | |
void | Split (vector< Vector3D > const &vIn, vector< double > &vX, vector< double > &vY, vector< double > &vZ) |
Splits a vector of 3D points to components. More... | |
3D Geometrical calculations
Definition in file Vector3D.hpp.
double abs | ( | Vector3D const & | v | ) |
Norm of a vector.
v | Three dimensional vector |
Definition at line 44 of file Vector3D.cpp.
Returns the angle between two vectors (in radians)
v1 | First vector |
v2 | Second vector |
Definition at line 198 of file Vector3D.cpp.
Returns the cross product of two vectors.
v1 | First vector |
v2 | Second vector |
Definition at line 213 of file Vector3D.cpp.
Calculates the distance between two vectors.
v1 | First vector |
v2 | Second vector |
Definition at line 208 of file Vector3D.cpp.
Scalar product.
d | Scalar |
v | Vector |
Definition at line 162 of file Vector3D.cpp.
Scalar product.
v | Vector |
d | Scalar |
Definition at line 171 of file Vector3D.cpp.
Term by term addition.
v1 | First vector |
v2 | Second vector |
Definition at line 143 of file Vector3D.cpp.
Term by term subtraction.
v1 | First vector |
v2 | Second vector |
Definition at line 152 of file Vector3D.cpp.
Scalar division.
v | Vector |
d | Scalar |
Definition at line 176 of file Vector3D.cpp.
Calculates the projection of one vector in the direction of the second.
v1 | First vector |
v2 | Direction of the projection |
Definition at line 193 of file Vector3D.cpp.
Reflect vector.
v | Vector |
normal | Normal to the reflection plane |
Definition at line 203 of file Vector3D.cpp.
Rotates a 3D-vector around the X axis.
v | Vector |
a | (in radians) |
Definition at line 17 of file Vector3D.cpp.
Rotates a 3D-vector around the Y axis.
v | Vector |
a | (in radians) |
Definition at line 26 of file Vector3D.cpp.
Rotates a 3D-vector around the Z axis.
v | Vector |
a | (in radians) |
Definition at line 35 of file Vector3D.cpp.
Scalar product of two vectors.
v1 | 3D vector |
v2 | 3D vector |
Definition at line 185 of file Vector3D.cpp.
void Split | ( | vector< Vector3D > const & | vIn, |
vector< double > & | vX, | ||
vector< double > & | vY, | ||
vector< double > & | vZ | ||
) |
Splits a vector of 3D points to components.
vIn | Input vector of 3D points |
vX | Vector of x coordinates (out) |
vY | Vector of y coordinates (out) |
vZ | Vector of z coordinates (out) |
Definition at line 222 of file Vector3D.cpp.