#include <vector3d.h>
It is a templated version so the implementation is in the header file.
Definition at line 43 of file vector3d.h.
Public Member Functions | |
Vector3D () | |
The default constructor. | |
Vector3D (const T x, const T y, const T z) | |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. It allows setting the values explicitly. | |
Vector3D (const T x1, const T y1, const T z1, const T x2, const T y2, const T z2) | |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. It constructs a vector from 2 points. | |
Vector3D (const Point3D< T > point1, const Point3D< T > point2) | |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. It constructs a vector from 2 points. | |
Vector3D (const Vector3D &v) | |
The copy constructor. | |
~Vector3D () | |
The default destructor. | |
bool | isUnit () const |
Returns true if the vector is a unit vector. | |
bool | isZero () const |
Returns true if the vector has zero length. | |
T | x () const |
Returns the x-component of the vector. | |
T | y () const |
Returns the y-component of the vector. | |
T | z () const |
Returns the z-component of the vector. | |
T | length () const |
Returns the length of the vector. | |
void | setValues (const T x, const T y, const T z) |
Sets the values of all vector components. | |
void | normalize () |
Normalizes the vector. | |
void | setLength (const T newLength) |
Sets a new length for the vector. | |
void | changeLength (const T amount) |
Makes the vector amount longer (or shorter if negative). | |
void | invert () |
Inverts the direction of the vector. | |
void | add (const Vector3D v) |
Adds the vector v to the current vector. | |
void | rotate (const Vector3D axis, const T angle) |
Rotates the vector by the specified angle around the given axis. | |
void | setTorsion (const T angle, const Vector3D refBond, const Vector3D centralBond) |
Changes the orientation of the current vector to give the specified torsion angle with the refBond around the centralBond . | |
Vector3D | cross (const Vector3D v) const |
Calculates the cross product of the vector v and the current vector. | |
T | dot (const Vector3D v) const |
Calculates the dot product of the vector v and the current vector. | |
T | angle (const Vector3D v) const |
Calculates the angle between the vector v and the current vector. | |
T | torsion (const Vector3D v1, const Vector3D v2) const |
Calculates the torsion angle between the current vector and vector v1 around vector v2 . | |
Private Attributes | |
T | xVect |
T | yVect |
T | zVect |
The vector values. |
|
The default constructor.
Definition at line 87 of file vector3d.h. |
|
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. It allows setting the values explicitly.
Definition at line 94 of file vector3d.h. |
|
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. It constructs a vector from 2 points.
Definition at line 102 of file vector3d.h. |
|
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. It constructs a vector from 2 points.
Definition at line 110 of file vector3d.h. |
|
The copy constructor.
Definition at line 118 of file vector3d.h. |
|
The default destructor.
Definition at line 127 of file vector3d.h. |
|
Returns true if the vector is a unit vector.
Definition at line 134 of file vector3d.h. |
|
Returns true if the vector has zero length.
Definition at line 144 of file vector3d.h. |
|
Returns the x-component of the vector.
Definition at line 154 of file vector3d.h. |
|
Returns the y-component of the vector.
Definition at line 161 of file vector3d.h. |
|
Returns the z-component of the vector.
Definition at line 167 of file vector3d.h. |
|
Returns the length of the vector.
Definition at line 174 of file vector3d.h. |
|
Sets the values of all vector components.
Definition at line 181 of file vector3d.h. |
|
Normalizes the vector.
Definition at line 190 of file vector3d.h. |
|
Sets a new length for the vector.
Definition at line 209 of file vector3d.h. |
|
Makes the vector
Definition at line 222 of file vector3d.h. |
|
Inverts the direction of the vector.
Definition at line 238 of file vector3d.h. |
|
Adds the vector
Definition at line 247 of file vector3d.h. |
|
Rotates the vector by the specified angle around the given axis.
Definition at line 256 of file vector3d.h. |
|
Changes the orientation of the current vector to give the specified torsion angle with the
Definition at line 346 of file vector3d.h. |
|
Calculates the cross product of the vector
Definition at line 273 of file vector3d.h. |
|
Calculates the dot product of the vector
Definition at line 284 of file vector3d.h. |
|
Calculates the angle between the vector (arccos(dot(v1, v2))). The result is returned in degrees. Definition at line 291 of file vector3d.h. |
|
Calculates the torsion angle between the current vector and vector The result is returned in degrees. Definition at line 303 of file vector3d.h. |
|
Definition at line 79 of file vector3d.h. |
|
Definition at line 79 of file vector3d.h. |
|
The vector values.
Definition at line 79 of file vector3d.h. |