This file is the main header for 3d vector operations. More...
#include <math.h>#include <immintrin.h>#include "Vector3D.hpp"Go to the source code of this file.
Defines | |
| #define | VECTOR3D_DOTP_MASK 0x71 |
| #define | VECTOR3D_ROT1_MASK 0xC9 |
| #define | VECTOR3D_ROT2_MASK 0xD2 |
Typedefs | |
| typedef align16 __m128 | Vector3D__ |
| struct { | |
| float x | |
| float y | |
| float z | |
| float _ | |
| } | Vector3D_v |
| struct { | |
| float r | |
| float phi | |
| float z | |
| float _ | |
| } | Vector3D_c |
| struct { | |
| float r | |
| float phi | |
| float theta | |
| float _ | |
| } | Vector3D_s |
| union { | |
| align16 Vector3D__ _ | |
| align16 Vector3D_v v | |
| align16 Vector3D_c c | |
| align16 Vector3D_s s | |
| } | Vector3D_t |
Functions | |
| __forceinline Vector3D_t | Vector3D () |
| vector zero initializer | |
| __forceinline Vector3D_t | Vector3D (register float S0) |
| vector float initializer | |
| __forceinline Vector3D_t | Vector3D (register float x, register float y, register float z) |
| cartesian vector initializer | |
| __forceinline Vector3D_t | Vector3DC (register float r, register float phi, register float z) |
| cylindrical vector initializer | |
| __forceinline Vector3D_t | Vector3DS (register float r, register float phi, register float theta) |
| spherical vector initializer | |
| __forceinline Vector3D_t | add (register Vector3D_t L0, register Vector3D_t R0) |
| vector addition | |
| __forceinline void | add_ (register Vector3D_t &L0, register Vector3D_t R0) |
| vector addition-assignment (L0 += R0) | |
| __forceinline Vector3D_t | sub (register Vector3D_t L0, register Vector3D_t R0) |
| vector subtraction | |
| __forceinline void | sub_ (register Vector3D_t &L0, register Vector3D_t R0) |
| vector subtraction-assignment (L0 -= R0) | |
| __forceinline Vector3D_t | mul (register Vector3D_t L0, register float R0) |
| scalar vector multiplication | |
| __forceinline void | mul_ (register Vector3D_t &L0, register float R0) |
| scalar vector multiplication-assignment (L0 *= R0) | |
| __forceinline Vector3D_t | div (register Vector3D_t L0, register float R0) |
| scalar vector division | |
| __forceinline void | div_ (register Vector3D_t &L0, register float R0) |
| scalar vector division-assignment (L0 /= R0) | |
| __forceinline float | dot (register Vector3D_t L0, register Vector3D_t R0) |
| the cartesian dot (or scalar) product resp. the inner product of the euclidean vector space | |
| __forceinline Vector3D_t | cross (register Vector3D_t L0, register Vector3D_t R0) |
| the cartesian cross product | |
| __forceinline void | cross_ (register Vector3D_t &L0, register Vector3D_t R0) |
| the self-assigning cartesian cross product (L0 x= R0) | |
| __forceinline float | triple (register Vector3D_t L0, register Vector3D_t M0, register Vector3D_t R0) |
| the cartesian vector-valued vector triple product | |
| __forceinline float | abs (register Vector3D_t V0) |
| the cartesian absolute value resp. length of a vector | |
| __forceinline float | absC (register Vector3D_t V0) |
| the cylindrical absolute value resp. length of a vector | |
| __forceinline float | absS (register Vector3D_t V0) |
| the spherical absolute value resp. length of a vector | |
| __forceinline Vector3D_t | unit (register Vector3D_t V0) |
| the cartesian unit vector | |
| __forceinline void | unit_ (register Vector3D_t &V0) |
| self-assign the cartesian unit vector: V0 /= abs(V0) | |
| __forceinline Vector3D_t | unitC (register Vector3D_t V0) |
| the cylindrical unit vector | |
| __forceinline void | unitC_ (register Vector3D_t &V0) |
| self-assign the cylindrical unit vector: V0 = ( V0.c.r/abs(V0) , 0.0f , V0.c.z/abs(V0) ) | |
| __forceinline Vector3D_t | unitS (register Vector3D_t V0) |
| the sherical unit vector | |
| __forceinline void | unitS_ (register Vector3D_t &V0) |
| self-assign the spherical unit vector: V0 = ( 1.0f , V0.s.phi , V0.s.theta ) | |
| __forceinline Vector3D_t | v2c (register Vector3D_t V0) |
| convert cartesian coordinates to cylindrical coordinates | |
| __forceinline void | v2c_ (register Vector3D_t &V0) |
| convert cartesian coordinates to cylindrical coordinates (self-assigned) | |
| __forceinline Vector3D_t | v2s (register Vector3D_t V0) |
| convert cartesian coordinates to spherical coordinates | |
| __forceinline void | v2s_ (register Vector3D_t &V0) |
| convert cartesian coordinates to spherical coordinates (self-assigned) | |
| __forceinline Vector3D_t | c2v (register Vector3D_t V0) |
| convert cylindrical coordinates to cartesian coordinates | |
| __forceinline void | c2v_ (register Vector3D_t &V0) |
| convert cylindrical coordinates to cartesian coordinates (self-assigned) | |
| __forceinline Vector3D_t | c2s (register Vector3D_t V0) |
| convert cylindrical coordinates to spherical coordinates | |
| __forceinline void | c2s_ (register Vector3D_t &V0) |
| convert cylindrical coordinates to spherical coordinates (self-assigned) | |
| __forceinline Vector3D_t | s2v (register Vector3D_t V0) |
| convert spherical coordinates to cartesian coordinates | |
| __forceinline void | s2v_ (register Vector3D_t &V0) |
| convert spherical coordinates to cartesian coordinates (self-assigned) | |
| __forceinline Vector3D_t | s2c (register Vector3D_t V0) |
| convert spherical coordinates to cylindrical coordinates | |
| __forceinline void | s2c_ (register Vector3D_t &V0) |
| convert spherical coordinates to cylindrical coordinates (self-assigned) | |
This file is the main header for 3d vector operations.
This file is the header which defines data types and declares functions for 3d vector operations such as addition/subtraction, multiplication/division dot/cross/triple-product, absolute values, normalization and angular functions.
| __forceinline float abs | ( | register Vector3D_t | V0 ) |
the cartesian absolute value resp. length of a vector
| V0 | the vector in cartesian coordinates |
| __forceinline float absC | ( | register Vector3D_t | V0 ) |
the cylindrical absolute value resp. length of a vector
| V0 | the vector in cylindrical coordinates |
| __forceinline float absS | ( | register Vector3D_t | V0 ) |
the spherical absolute value resp. length of a vector
| V0 | the vector in spherical coordinates |
| __forceinline Vector3D_t add | ( | register Vector3D_t | L0, |
| register Vector3D_t | R0 | ||
| ) |
vector addition
| L0 | the left hand sided operand |
| R0 | the right hand sided operand |
| __forceinline void add_ | ( | register Vector3D_t & | L0, |
| register Vector3D_t | R0 | ||
| ) |
vector addition-assignment (L0 += R0)
| L0 | the left hand sided operand, this parameter will also hold the result |
| R0 | the right hand sided operand |
| __forceinline Vector3D_t c2s | ( | register Vector3D_t | V0 ) |
convert cylindrical coordinates to spherical coordinates
| V0 | the vector in cylindrical coordinates |
| __forceinline void c2s_ | ( | register Vector3D_t & | V0 ) |
convert cylindrical coordinates to spherical coordinates (self-assigned)
| V0 | the vector in cylindrical coordinates |
| __forceinline Vector3D_t c2v | ( | register Vector3D_t | V0 ) |
convert cylindrical coordinates to cartesian coordinates
| V0 | the vector in cylindrical coordinates |
| __forceinline void c2v_ | ( | register Vector3D_t & | V0 ) |
convert cylindrical coordinates to cartesian coordinates (self-assigned)
| V0 | the vector in cylindrical coordinates |
| __forceinline Vector3D_t cross | ( | register Vector3D_t | L0, |
| register Vector3D_t | R0 | ||
| ) |
the cartesian cross product
| L0 | the left hand sided (vector) operand in cartesian coordinates |
| R0 | the right hand sided (vector) operand in cartesian coordinates |
| __forceinline void cross_ | ( | register Vector3D_t & | L0, |
| register Vector3D_t | R0 | ||
| ) |
the self-assigning cartesian cross product (L0 x= R0)
| L0 | the left hand sided (vector) operand in cartesian coordinates, this parameter will also hold the result |
| R0 | the right hand sided (vector) operand in cartesian coordinates |
| __forceinline Vector3D_t div | ( | register Vector3D_t | L0, |
| register float | R0 | ||
| ) |
scalar vector division
| L0 | the left hand sided (vector) operand |
| R0 | the right hand sided (scalar) operand |
| __forceinline void div_ | ( | register Vector3D_t & | L0, |
| register float | R0 | ||
| ) |
scalar vector division-assignment (L0 /= R0)
| L0 | the left hand sided (vector) operand, this parameter will also hold the result |
| R0 | the right hand sided (scalar) operand |
| __forceinline float dot | ( | register Vector3D_t | L0, |
| register Vector3D_t | R0 | ||
| ) |
the cartesian dot (or scalar) product resp. the inner product of the euclidean vector space
| L0 | the left hand sided (vector) operand in cartesian coordinates |
| R0 | the right hand sided (vector) operand in cartesian coordinates |
| __forceinline Vector3D_t mul | ( | register Vector3D_t | L0, |
| register float | R0 | ||
| ) |
scalar vector multiplication
| L0 | the left hand sided (vector) operand |
| R0 | the right hand sided (scalar) operand |
| __forceinline void mul_ | ( | register Vector3D_t & | L0, |
| register float | R0 | ||
| ) |
scalar vector multiplication-assignment (L0 *= R0)
| L0 | the left hand sided (vector) operand, this parameter will also hold the result |
| R0 | the right hand sided (scalar) operand |
| __forceinline Vector3D_t s2c | ( | register Vector3D_t | V0 ) |
convert spherical coordinates to cylindrical coordinates
| V0 | the vector in spherical coordinates |
| __forceinline void s2c_ | ( | register Vector3D_t & | V0 ) |
convert spherical coordinates to cylindrical coordinates (self-assigned)
| V0 | the vector in spherical coordinates |
| __forceinline Vector3D_t s2v | ( | register Vector3D_t | V0 ) |
convert spherical coordinates to cartesian coordinates
| V0 | the vector in spherical coordinates |
| __forceinline void s2v_ | ( | register Vector3D_t & | V0 ) |
convert spherical coordinates to cartesian coordinates (self-assigned)
| V0 | the vector in spherical coordinates |
| __forceinline Vector3D_t sub | ( | register Vector3D_t | L0, |
| register Vector3D_t | R0 | ||
| ) |
vector subtraction
| L0 | the left hand sided operand |
| R0 | the right hand sided operand |
| __forceinline void sub_ | ( | register Vector3D_t & | L0, |
| register Vector3D_t | R0 | ||
| ) |
vector subtraction-assignment (L0 -= R0)
| L0 | the left hand sided operand, this parameter will also hold the result |
| R0 | the right hand sided operand |
| __forceinline float triple | ( | register Vector3D_t | L0, |
| register Vector3D_t | M0, | ||
| register Vector3D_t | R0 | ||
| ) |
the cartesian vector-valued vector triple product
| L0 | the left hand sided (vector) operand in cartesian coordinates |
| M0 | the middle (vector) operand in cartesian coordinates |
| R0 | the right hand sided (vector) operand in cartesian coordinates |
| __forceinline Vector3D_t unit | ( | register Vector3D_t | V0 ) |
the cartesian unit vector
| V0 | the vector |
| __forceinline void unit_ | ( | register Vector3D_t & | V0 ) |
self-assign the cartesian unit vector: V0 /= abs(V0)
| V0 | the vector |
| __forceinline Vector3D_t unitC | ( | register Vector3D_t | V0 ) |
the cylindrical unit vector
| V0 | the vector |
| __forceinline void unitC_ | ( | register Vector3D_t & | V0 ) |
self-assign the cylindrical unit vector: V0 = ( V0.c.r/abs(V0) , 0.0f , V0.c.z/abs(V0) )
| V0 | the vector |
| __forceinline Vector3D_t unitS | ( | register Vector3D_t | V0 ) |
the sherical unit vector
| V0 | the vector |
| __forceinline void unitS_ | ( | register Vector3D_t & | V0 ) |
self-assign the spherical unit vector: V0 = ( 1.0f , V0.s.phi , V0.s.theta )
| V0 | the vector |
| __forceinline Vector3D_t v2c | ( | register Vector3D_t | V0 ) |
convert cartesian coordinates to cylindrical coordinates
| V0 | the vector in cartesian coordinates |
| __forceinline void v2c_ | ( | register Vector3D_t & | V0 ) |
convert cartesian coordinates to cylindrical coordinates (self-assigned)
| V0 | the vector in cartesian coordinates |
| __forceinline Vector3D_t v2s | ( | register Vector3D_t | V0 ) |
convert cartesian coordinates to spherical coordinates
| V0 | the vector in cartesian coordinates |
| __forceinline void v2s_ | ( | register Vector3D_t & | V0 ) |
convert cartesian coordinates to spherical coordinates (self-assigned)
| V0 | the vector in cartesian coordinates |
| __forceinline Vector3D_t Vector3D | ( | register float | x, |
| register float | y, | ||
| register float | z | ||
| ) |
cartesian vector initializer
| x | initialization value for the x coordinate |
| y | initialization value for the y coordinate |
| z | initialization value for the z coordinate |
| __forceinline Vector3D_t Vector3D | ( | ) |
vector zero initializer
| __forceinline Vector3D_t Vector3D | ( | register float | S0 ) |
vector float initializer
| S0 | initialization value |
| __forceinline Vector3D_t Vector3DC | ( | register float | r, |
| register float | phi, | ||
| register float | z | ||
| ) |
cylindrical vector initializer
| r | initialization value for the r coordinate (radial coordinate) |
| phi | initialization value for the phi coordinate (polar coordinate) |
| z | initialization value for the z coordinate |
| __forceinline Vector3D_t Vector3DS | ( | register float | r, |
| register float | phi, | ||
| register float | theta | ||
| ) |
spherical vector initializer
| r | initialization value for the r coordinate (radial coordinate) |
| phi | initialization value for the phi coordinate (polar coordinate) |
| theta | initialization value for the theta coordinate (azimuthal coordinate) |
1.7.2