|
Path Tracer
|
#include "DoubleVec3D.h"Functions | |
| 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... | |
| DoubleVec3D crossProd | ( | const DoubleVec3D & | vec1, |
| const DoubleVec3D & | vec2 | ||
| ) |
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.
| vec1 | The first vector for the product. |
| vec2 | The second vector for the product. |
| double dotProd | ( | const DoubleVec3D & | vec1, |
| const DoubleVec3D & | vec2 | ||
| ) |
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.
| vec1 | The first vector for the product. |
| vec2 | The second vector for the product. |
| void from_json | ( | const json & | j, |
| DoubleVec3D & | vec | ||
| ) |
Conversion from json.
Used for the .get<DoubleVec3D>() function.
| j | Json input. |
| vec | The output vector. |
| double length | ( | const DoubleVec3D & | vec | ) |
| DoubleVec3D operator* | ( | const double & | val, |
| const DoubleVec3D & | vec | ||
| ) |
Multiplication by a scalar operator (commutative).
Uses the DoubleVec3D::operator*=() method.
| vec | The vector that will get multiplied. |
| val | The scalar that will multiply the vector. |
| DoubleVec3D operator* | ( | const DoubleVec3D & | vec, |
| const double & | val | ||
| ) |
Multiplication by a scalar operator (commutative).
Uses the DoubleVec3D::operator*=() method.
| vec | The vector that will get multiplied. |
| val | The scalar that will multiply the vector. |
| DoubleVec3D operator+ | ( | const DoubleVec3D & | vec1, |
| const DoubleVec3D & | vec2 | ||
| ) |
Sum operator.
Uses the DoubleVec3D::operator+=() method.
| vec1 | The first vector for the sum. |
| vec2 | The second vector for the sum. |
| DoubleVec3D operator- | ( | const DoubleVec3D & | vec | ) |
Unary minus operator.
Uses the DoubleVec3D::operator*=() method.
| vec | The vector that will be inversed. |
| DoubleVec3D operator- | ( | const DoubleVec3D & | vec1, |
| const DoubleVec3D & | vec2 | ||
| ) |
Difference operator.
Uses the DoubleVec3D::operator-=() method.
| vec1 | The first vector for the difference. |
| vec2 | The second vector for the difference. |
| DoubleVec3D operator/ | ( | const DoubleVec3D & | vec, |
| const double & | val | ||
| ) |
Division by a scalar operator.
Uses the DoubleVec3D::operator/=() method.
| vec | The vector that will get divided. |
| val | The scalar that will divide the vector. |
| std::ostream & operator<< | ( | std::ostream & | stream, |
| const DoubleVec3D & | vec | ||
| ) |
Ostream operator.
Displays vectors under the form "(x, y, z)"
| stream | The ostream before. |
| vec | The vector that will be added to the stream. |
| void to_json | ( | json & | j, |
| const DoubleVec3D & | vec | ||
| ) |
Conversion to json.
| j | Json output. |
| vec | The vector that will be converted. |