|
Jameo Core Library
|
A three dimensional vector. Owns special functions for 3D space. More...
Public Member Functions | |
| Vertex3 (double x=0, double y=0, double z=0) noexcept | |
| Constructor for arbitrary vector. | |
| Vertex3 (const Vertex2 &xy, double z=0) noexcept | |
| Constructor for arbitrary vector. | |
| Vertex3 (const Vertex3 &another) noexcept=default | |
| Copy constructor. | |
| Vertex3 | crossProduct (const Vertex3 &another) const |
| Calculates the cross-product of this vector with the other. | |
| double | dotProduct (const Vertex3 &another) const |
| Calculates the dot product of this vector with another vector. The dot product is defined as the sum of the products of the corresponding components of the two vectors. | |
| bool | isCollinear (const Vertex3 &another) const |
| This method checks whether the two vectors are collinear. Two vectors are collinear if they are parallel to each other. | |
| bool | isOrthogonal (const Vertex3 &another) const |
| This method calculates whether the two vectors are orthogonal. Two vectors are orthogonal if they are perpendicular to each other. | |
| bool | isNull () const |
| This method checks if the vector is the zero vector (taking into account RESABS). | |
| bool | isValid () const |
| This method checks if the vector has any "NaN" entries. If all entries are defined, it returns true. | |
| double | angleTo (const Vertex3 &another) const |
| Returns the angle between this vector and another vector. | |
| double | abs () const |
| This method returns the absolute value of the vector. The absolute value is equal to the length. | |
| void | rotateX (double angle) |
| Rotates the vector around the X-axis by the specified angle. | |
| void | rotateY (double angle) |
| Rotates the vector around the Y-axis by the specified angle. | |
| void | rotateZ (double angle) |
| Rotates the vector around the Z-axis by the specified angle. | |
| Vertex3 | rotatedZ (double angle) const |
| Rotates the vector around the Z-axis by the specified angle and returns the result. | |
| void | rotate (double angle, const Vertex3 &axis) |
| Rotates the vector around the given axis by the specified angle. | |
| Vertex3 & | normalize () |
| This method normalizes the vector. A normalized vector has a length of 1 and the reference to this vector is returned. | |
| Vertex3 | normalized () const |
| This method returns a normalized vector. A normalized vector has a length of 1. This vector is not changed in the process. | |
| Vertex3 | scale (const Vertex3 &another) const |
| This method multiplies this vector line by line with the other vector. | |
| double | biggest () const |
| This method returns the largest component of x,y,z from this vector. | |
| Vertex3 & | operator+= (const Vertex3 &v) |
| Implementation of the operator +=. | |
| Vertex3 & | operator-= (const Vertex3 &v) |
| Implementation of the operator -=. | |
| Vertex3 | operator/ (double b) const |
| Implementation of the operator /. | |
| Vertex3 | operator+ (const Vertex3 &v1) const |
| Implementation of the operator +. | |
| Vertex3 | operator- (const Vertex3 &v1) const |
| Implementation of the operator -. | |
| Vertex3 & | operator= (const Vertex3 &another) |
Public Attributes | |
| double | x = 0.0 |
| X component of vector. | |
| double | y = 0.0 |
| Y component of vector. | |
| double | z = 0.0 |
| Z component of vector. | |
Friends | |
| DllExport friend std::ostream & | operator<< (std::ostream &out, const Vertex3 &vertex) |
| Implementation of the operator <<. | |
| DllExport friend String & | operator<< (String &out, const Vertex3 &vertex) |
| Implementation of the operator <<. | |
A three dimensional vector. Owns special functions for 3D space.
|
explicitnoexcept |
Constructor for arbitrary vector.
| x | X component of vector |
| y | Y component of vector |
| z | Z component of vector |
|
explicitnoexcept |
Constructor for arbitrary vector.
| xy | 2D Vector with x and y component. |
| z | Z component of vector |
|
defaultnoexcept |
Copy constructor.
| another | The other vector |
| double jm::Vertex3::abs | ( | ) | const |
This method returns the absolute value of the vector. The absolute value is equal to the length.
| double jm::Vertex3::angleTo | ( | const Vertex3 & | another | ) | const |
Returns the angle between this vector and another vector.
| another | The vector we want to know the angle to. |
| double jm::Vertex3::biggest | ( | ) | const |
This method returns the largest component of x,y,z from this vector.
Calculates the cross-product of this vector with the other.
| another | The other vector. |
| double jm::Vertex3::dotProduct | ( | const Vertex3 & | another | ) | const |
Calculates the dot product of this vector with another vector. The dot product is defined as the sum of the products of the corresponding components of the two vectors.
| another | The other vector. |
| bool jm::Vertex3::isCollinear | ( | const Vertex3 & | another | ) | const |
This method checks whether the two vectors are collinear. Two vectors are collinear if they are parallel to each other.
| another | The other vector. |
| bool jm::Vertex3::isNull | ( | ) | const |
This method checks if the vector is the zero vector (taking into account RESABS).
| bool jm::Vertex3::isOrthogonal | ( | const Vertex3 & | another | ) | const |
This method calculates whether the two vectors are orthogonal. Two vectors are orthogonal if they are perpendicular to each other.
| another | The other vector. |
| bool jm::Vertex3::isValid | ( | ) | const |
This method checks if the vector has any "NaN" entries. If all entries are defined, it returns true.
| Vertex3 & jm::Vertex3::normalize | ( | ) |
This method normalizes the vector. A normalized vector has a length of 1 and the reference to this vector is returned.
| Vertex3 jm::Vertex3::normalized | ( | ) | const |
This method returns a normalized vector. A normalized vector has a length of 1. This vector is not changed in the process.
| Vertex3 jm::Vertex3::operator/ | ( | double | b | ) | const |
Implementation of the operator /.
| void jm::Vertex3::rotate | ( | double | angle, |
| const Vertex3 & | axis | ||
| ) |
Rotates the vector around the given axis by the specified angle.
| angle | The rotation angle in radians. |
| axis | The rotation axis. |
| Vertex3 jm::Vertex3::rotatedZ | ( | double | angle | ) | const |
Rotates the vector around the Z-axis by the specified angle and returns the result.
| angle | The rotation angle in radians. |
| void jm::Vertex3::rotateX | ( | double | angle | ) |
Rotates the vector around the X-axis by the specified angle.
| angle | The rotation angle in radians. |
| void jm::Vertex3::rotateY | ( | double | angle | ) |
Rotates the vector around the Y-axis by the specified angle.
| angle | The rotation angle in radians. |
| void jm::Vertex3::rotateZ | ( | double | angle | ) |
Rotates the vector around the Z-axis by the specified angle.
| angle | The rotation angle in radians. |
This method multiplies this vector line by line with the other vector.
|
friend |
Implementation of the operator <<.
Implementation of the operator <<.
| double jm::Vertex3::x = 0.0 |
X component of vector.
| double jm::Vertex3::y = 0.0 |
Y component of vector.
| double jm::Vertex3::z = 0.0 |
Z component of vector.