|
|
| Vec3 () |
| | Default constructor creating a point at origin.
|
| |
|
| Vec3 (Real X, Real Y, Real Z=Real(0)) |
| | Constructor creating a point at the specified location.
|
| |
|
| Vec3 (const Real *pos, size_t n=3) |
| | Constructor creating a point at the specified location.
|
| |
|
| Vec3 (const std::vector< Real > &X) |
| | Constructor creating a point from the given std::vector.
|
| |
|
| Vec3 (const Vec3 &X) |
| | Copy constructor.
|
| |
|
| Vec3 (const Vec3 &X, const Vec3 &Y) |
| | Constructor creating a cross product of two other vectors.
|
| |
|
virtual | ~Vec3 () |
| | Empty destructor.
|
| |
|
Vec3 & | operator= (const Vec3 &X) |
| | Assignment operator.
|
| |
|
Vec3 & | operator= (Real val) |
| | Overloaded assignment operator.
|
| |
|
const Real & | operator() (int i) const |
| | Indexing operator for component reference (1-based).
|
| |
|
const Real & | operator[] (int i) const |
| | Indexing operator for component reference (0-based).
|
| |
|
Real & | operator() (int i) |
| | Indexing operator for component assignment (1-based).
|
| |
|
Real & | operator[] (int i) |
| | Indexing operator for component assignment (0-based).
|
| |
|
const Real * | ptr () const |
| | Reference through a pointer.
|
| |
|
std::vector< Real > | vec (size_t n=3) const |
| | Conversion to std::vector.
|
| |
|
Vec3 & | operator*= (Real c) |
| | Multiplication with a scalar.
|
| |
|
Vec3 & | operator/= (Real d) |
| | Division by a scalar.
|
| |
|
Vec3 & | operator+= (const Vec3 &X) |
| | Add the given vector X to *this.
|
| |
|
Vec3 & | operator-= (const Vec3 &X) |
| | Subtract the given vector X from *this.
|
| |
|
Vec3 | operator- () const |
| | Negation operator.
|
| |
|
Real | sum () const |
| | Return the sum of the vector components.
|
| |
|
Real | asum () const |
| | Return the sum of absolute values of the vector components.
|
| |
|
Real | length2 () const |
| | Return the square of the length of the vector.
|
| |
|
double | length () const |
| | Return the length of the vector.
|
| |
|
Real | normalize (double tol=1.0e-16) |
| | Normalize the vector and return its length.
|
| |
|
Vec3 & | cross (const Vec3 &a, const Vec3 &b) |
| | Cross product between two vectors.
|
| |
|
bool | equal (const Vec3 &a, double tol=1.0e-6) const |
| | Equality check between two vectors.
|
| |
|
bool | isZero (double tol=1.0e-6) const |
| | Check if the vector is zero with the given tolerance.
|
| |
| bool | lessThan (const Vec3 &a, double tol=1.0e-6) const |
| | Check if one vector is less than the other.
|
| |
|
bool | inside (const Vec3 &a, const Vec3 &b, double tol=1.0e-6) const |
| | Check if a vector is inside the box defined by two other vectors.
|
| |
| virtual std::ostream & | print (std::ostream &os, double tol=1.0e-12) const |
| | Print out a vector.
|
| |
Simple class for representing a point in 3D space.
| bool Vec3::lessThan |
( |
const Vec3 & |
a, |
|
|
double |
tol = 1.0e-6 |
|
) |
| const |
|
inline |
Check if one vector is less than the other.
First we compare the z-coordinates. Only if the z-coordinates are equal, we compare the y-coordinates, and if they are equal too, we finally compare the x-coordinates.
References v.
Referenced by operator<().