Defines the DoubleVec3D class and some functions around it.
More...
Go to the source code of this file.
|
| DoubleVec3D | operator+ (const DoubleVec3D &vec1, const DoubleVec3D &vec2) |
| | Sum operator. More...
|
| |
| DoubleVec3D | operator- (const DoubleVec3D &vec) |
| | Unary minus operator. More...
|
| |
| DoubleVec3D | operator- (const DoubleVec3D &vec1, const DoubleVec3D &vec2) |
| | Difference operator. More...
|
| |
| DoubleVec3D | operator* (const DoubleVec3D &vec, const double &val) |
| | Multiplication by a scalar operator (commutative). More...
|
| |
| DoubleVec3D | operator* (const double &val, const DoubleVec3D &vec) |
| | Multiplication by a scalar operator (commutative). More...
|
| |
| DoubleVec3D | operator/ (const DoubleVec3D &vec, const double &val) |
| | Division by a scalar operator. More...
|
| |
| std::ostream & | operator<< (std::ostream &stream, const DoubleVec3D &vec) |
| | Ostream operator. More...
|
| |
| DoubleVec3D | crossProd (const DoubleVec3D &vec1, const DoubleVec3D &vec2) |
| | Cross product. More...
|
| |
| double | dotProd (const DoubleVec3D &vec1, const DoubleVec3D &vec2) |
| | Dot product. More...
|
| |
| double | length (const DoubleVec3D &vec) |
| | Gives the norm of the vector. More...
|
| |
| void | to_json (json &j, const DoubleVec3D &vec) |
| | Conversion to json. More...
|
| |
| void | from_json (const json &j, DoubleVec3D &vec) |
| | Conversion from json. More...
|
| |
Defines the DoubleVec3D class and some functions around it.
◆ crossProd()
Cross product.
A cross prodct gives a third vector, orthogonal to the two previous. Its length is given by the area of the parallelogram drawn by vec1 and vec2.
- Parameters
-
| vec1 | The first vector for the product. |
| vec2 | The second vector for the product. |
- Returns
- The cross product between vec1 and vec2.
◆ dotProd()
Dot product.
A dot product gives the product of the norm of each vector, multiplied by the cosine of the angle between the two vectors.
- Parameters
-
| vec1 | The first vector for the product. |
| vec2 | The second vector for the product. |
- Returns
- The dot product between vec1 and vec2.
- See also
- length()
◆ from_json()
Conversion from json.
Used for the .get<DoubleVec3D>() function.
- Parameters
-
| j | Json input. |
| vec | The output vector. |
◆ length()
Gives the norm of the vector.
Uses the dotProd() method.
- Parameters
-
| vec | The vector from which the norm will be computed. |
- Returns
- The norm of this vector.
- See also
- dotProd()
◆ operator*() [1/2]
◆ operator*() [2/2]
◆ operator+()
◆ operator-() [1/2]
◆ operator-() [2/2]
◆ operator/()
◆ operator<<()
| std::ostream& operator<< |
( |
std::ostream & |
stream, |
|
|
const DoubleVec3D & |
vec |
|
) |
| |
Ostream operator.
Displays vectors under the form "(x, y, z)"
- Parameters
-
| stream | The ostream before. |
| vec | The vector that will be added to the stream. |
- Returns
- The stream with the vector added.
◆ to_json()
Conversion to json.
- Parameters
-
| j | Json output. |
| vec | The vector that will be converted. |