#include <Utils.h>
Public Member Functions | |
| void | dot (const std::array< T, 3 > &v1, const std::array< T, 3 > &v2, T &out) |
| void | dot (const std::array< std::complex< T >, 3 > &cv1, const std::array< std::complex< T >, 3 > &cv2, std::complex< T > &out) |
| void | dot (const std::array< std::complex< T >, 3 > &cv1, const std::array< T, 3 > &v2, std::complex< T > &out) |
| void | dot (const std::array< T, 3 > &v1, const std::array< std::complex< T >, 3 > &cv2, std::complex< T > &out) |
| void | ext (const std::array< T, 3 > &v1, const std::array< T, 3 > &v2, std::array< T, 3 > &out) |
| void | ext (const std::array< std::complex< T >, 3 > &cv1, const std::array< std::complex< T >, 3 > &cv2, std::array< std::complex< T >, 3 > &out) |
| void | ext (const std::array< std::complex< T >, 3 > &cv1, const std::array< T, 3 > &v2, std::array< std::complex< T >, 3 > &out) |
| void | ext (const std::array< T, 3 > &v1, const std::array< std::complex< T >, 3 > &cv2, std::array< std::complex< T >, 3 > &out) |
| void | abs (const std::array< T, 3 > &v, T &out) |
| void | diff (const std::array< T, 3 > &v1, const std::array< T, 3 > &v2, std::array< T, 3 > &out) |
| void | diff (const std::array< std::complex< T >, 3 > &cv1, const std::array< std::complex< T >, 3 > &cv2, std::array< std::complex< T >, 3 > &out) |
| void | normalize (const std::array< T, 3 > &v, std::array< T, 3 > &out) |
| void | add (const std::array< T, 3 > &v1, const std::array< T, 3 > &v2, std::array< T, 3 > &out) |
| void | s_mult (const std::array< T, 3 > &v, const T &s, std::array< T, 3 > &out) |
| void | s_mult (const std::array< std::complex< T >, 3 > &cv, const std::complex< T > &cs, std::array< std::complex< T >, 3 > &out) |
| void | s_mult (const std::array< T, 3 > &v, const std::complex< T > &cs, std::array< std::complex< T >, 3 > &out) |
| void | s_mult (const std::array< std::complex< T >, 3 > &cv, const T &s, std::array< std::complex< T >, 3 > &out) |
| void | conj (const std::array< std::complex< T >, 3 > &cv, std::array< std::complex< T >, 3 > &out) |
| void | snell (const std::array< T, 3 > &vin, const std::array< T, 3 > &normal, std::array< T, 3 > &out) |
| void | snell_t (const std::array< T, 3 > &vin, const std::array< T, 3 > &normal, T mu, std::array< T, 3 > &out) |
| void | dyad (const std::array< T, 3 > &v1, const std::array< T, 3 > &v2, std::array< std::array< T, 3 >, 3 > &out) |
| void | matDiff (const std::array< std::array< T, 3 >, 3 > &m1, const std::array< std::array< T, 3 >, 3 > &m2, std::array< std::array< T, 3 >, 3 > &out) |
| void | matVec (const std::array< std::array< T, 3 >, 3 > &m1, const std::array< T, 3 > &v1, std::array< T, 3 > &out) |
| void | matVec (const std::array< std::array< T, 3 >, 3 > &m1, const std::array< std::complex< T >, 3 > &cv1, std::array< std::complex< T >, 3 > &out) |
| void | matVec4 (const T *m1, const std::array< T, 3 > &v1, std::array< T, 3 > &out, bool vec=false) |
| void | invmatVec4 (const T *m1, const std::array< T, 3 > &v1, std::array< T, 3 > &out, bool vec=false) |
| void | matRot (const std::array< T, 3 > &rot, const std::array< T, 3 > &v1, const std::array< T, 3 > &cRot, std::array< T, 3 > &out) |
Class for basic 3D linear algebra functions.
Note that no function returns. All values are stored inside a variable which is passed by reference to the function.
|
inline |
Absolute value.
Calculate absolute value of real valued vector of size 3.
| v | Array of 3 double/float. |
| out | Scalar double/float. |
|
inline |
Vector addition.
Add two real valued vectors of size 3 element-wise.
| v1 | Array of 3 double/float. |
| v2 | Array of 3 double/float. |
| out | Array of 3 complex double/float. |
|
inline |
Conjugate.
Conjugate complex valued vector of size 3.
| cv | Array of 3 complex double/float. |
| out | Array of 3 complex double/float. |
|
inline |
Component-wise vector difference.
Subtract two complex valued vectors of size 3, element-wise.
| cv1 | Array of 3 complex double/float. |
| cv2 | Array of 3 complex double/float. |
| out | Array of 3 complex double/float. |
|
inline |
Component-wise vector difference.
Subtract two real valued vectors of size 3, element-wise.
| v1 | Array of 3 double/float. |
| v2 | Array of 3 double/float. |
| out | Array of 3 double/float. |
|
inline |
Dot product.
Take the dot (inner) product of two complex valued double/float arrays of size 3.
| cv1 | Array of 3 complex double/float. |
| cv2 | Array of 3 complex double/float. |
| out | Scalar complex double/float. |
|
inline |
Dot product.
Take the dot (inner) product of one complex valued and one real valued double/float array of size 3.
| cv1 | Array of 3 complex double/float. |
| v2 | Array of 3 double/float. |
| out | Scalar complex double/float. |
|
inline |
Dot product.
Take the dot (inner) product of one real valued and one complex valued double/float array of size 3.
| v1 | Array of 3 double/float. |
| cv2 | Array of 3 complex double/float. |
| out | Scalar complex double/float. |
|
inline |
Dot product.
Take the dot (inner) product of two real valued arrays of size 3.
| v1 | Array of 3 double/float. |
| v2 | Array of 3 double/float. |
| out | Scalar double/float. |
|
inline |
Dyadic product.
Calculate dyadic product between two real valued double/float vectors of size 3.
| v1 | Array of 3 double/float. |
| v2 | Array of 3 double/float. |
| out | Array of 3 double/float, nested inside array of size 3. |
|
inline |
Cross product.
Take the cross (outer) product of two complex valued double/float arrays of size 3.
| cv1 | Array of 3 complex double/float. |
| cv2 | Array of 3 complex double/float. |
| out | Array of 3 complex double/float. |
|
inline |
Cross product.
Take the cross (outer) product of one complex valued and one real valued double/float array of size 3.
| cv1 | Array of 3 complex double/float. |
| v2 | Array of 3 double/float. |
| out | Array of 3 complex double/float. |
|
inline |
Cross product.
Take the cross (outer) product of one real valued and one complex valued double/float array of size 3.
| v1 | Array of 3 double/float. |
| cv2 | Array of 3 complex double/float. |
| out | Array of 3 complex double/float. |
|
inline |
Cross product.
Take the cross (outer) product of two real valued double/float arrays of size 3.
| v1 | Array of 3 double/float. |
| v2 | Array of 3 double/float. |
| out | Array of 3 double/float. |
|
inline |
Inverse matrix-vector product.
Multiply the inverse of a real valued 4x4 matrix by a real valued size 3 vector to generate a new size 3 vector. This function is only used for multiplying 3D vectors by a 4D transformation matrix.
| m1 | Array of 4 double/float, nested inside array of size 4. |
| v1 | Array of 3 double/float. |
| out | Array of 3 double/float. |
| vec | Whether or not to transform v1 as a point or a vector. |
|
inline |
Matrix difference, element wise.
Subtract two 3x3 matrices, element wise.
| m1 | Array of 3 double/float, nested inside array of size 3. |
| m2 | Array of 3 double/float, nested inside array of size 3. |
| out | Array of 3 double/float, nested inside array of size 3. |
|
inline |
Manual vector rotation.
Rotate a real valued size 3 vector without defining a transformation matrix.
| rot | Array of 3 double/float, containing rotation angles. |
| v1 | Array of 3 double/float. |
| cRot | Array of 3, center of rotation. |
| out | Array of 3 double/float. |
|
inline |
Matrix-vector product.
Multiply a real valued 3x3 matrix and a complex valued size 3 vector to generate a new complex valued size 3 vector.
| m1 | Array of 3 double/float, nested inside array of size 3. |
| cv1 | Array of 3 complex double/float. |
| out | Array of 3 complex double/float. |
|
inline |
Matrix-vector product.
Multiply a real valued 3x3 matrix and a real valued size 3 vector to generate a new real valued size 3 vector.
| m1 | Array of 3 double/float, nested inside array of size 3. |
| v1 | Array of 3 double/float. |
| out | Array of 3 double/float. |
|
inline |
Matrix-vector product.
Multiply a real valued 4x4 matrix and a real valued size 3 vector to generate a new real valued size 3 vector. This function is only used for multiplying 3D vectors by a 4D transformation matrix.
| m1 | Array of 4 double/float, nested inside array of size 4. |
| v1 | Array of 3 double/float. |
| out | Array of 3 double/float. |
| vec | Whether or not to transform v1 as a point or a vector. |
|
inline |
Normalize vector.
Normalize real valued vector of size 3.
| v | Array of 3 double/float. |
| out | Array of 3 double/float. |
|
inline |
Scalar multiplication.
Multiply complex valued vector of size 3 by complex scalar, element-wise.
| cv | Array of 3 complex double/float. |
| cs | Scalar complex double/float. |
| out | Array of 3 complex double/float. |
|
inline |
Scalar multiplication.
Multiply complex valued vector of size 3 by real scalar, element-wise.
| cv | Array of 3 complex double/float. |
| s | Scalar double/float. |
| out | Array of 3 complex double/float. |
|
inline |
Scalar multiplication.
Multiply real valued vector of size 3 by complex scalar, element-wise.
| v | Array of 3 double/float. |
| cs | Scalar complex double/float. |
| out | Array of 3 complex double/float. |
|
inline |
Scalar multiplication.
Multiply real valued vector of size 3 by real scalar, element-wise.
| v | Array of 3 double/float. |
| s | Scalar double/float. |
| out | Array of 3 double/float. |
|
inline |
Snell's law for reflection.
Calculate reflected direction vector from incoming direction and normal vector.
| vin | Array of 3 double/float, incoming direction vector. |
| normal | Array of 3 double/float, normal vector of surface. |
| out | Array of 3 double/float. |
|
inline |
Snell's law refraction.
Calculate refracted direction vector from incoming direction and normal vector.
| vin | Array of 3 double/float, incoming direction vector. |
| normal | Array of 3 double/float, normal vector of surface. |
| mu | Ratio of n1 to n2. |
| out | Array of 3 double/float. |