25 _x0(x0), _x1(x1), _x2(x2) {}
31 const Vec3 n = -p.normalized();
32 const Vec3 c = n.cross(v).normalized();
33 const Vec3 t = c.cross(n).normalized();
40 CUDA_HOSTDEV
const Vec3&
x0()
const {
return _x0; }
43 CUDA_HOSTDEV
const Vec3&
x1()
const {
return _x1; }
46 CUDA_HOSTDEV
const Vec3&
x2()
const {
return _x2; }
66 return Vec3 { _x0.dot(vec),
80 for(
int ii =0; ii < 3; ii++) {
81 res[ii] = vec[0] * _x0[ii] + vec[1] * _x1[ii] + vec[2] * _x2[ii];
CUDA_HOSTDEV Basis(const Vec3 &x0, const Vec3 &x1, const Vec3 &x2)
Constructor with basis vectors.
Definition: Basis.h:24
CUDA_HOSTDEV const Vec3 & x1() const
Return second basis vector.
Definition: Basis.h:43
CUDA_HOSTDEV void x1(const Vec3 &x1)
Set the second basis vector.
Definition: Basis.h:52
CUDA_HOSTDEV Vec3 project(Vec3 &vec)
Project a given vector onto basis.
Definition: Basis.h:65
CUDA_HOSTDEV const Vec3 & x0() const
Return first basis vector.
Definition: Basis.h:40
CUDA_HOSTDEV Basis()
Default constructor.
Definition: Basis.h:20
CUDA_HOSTDEV Basis(const Vec3 &p, const Vec3 &v)
Geocentric TCN constructor.
Definition: Basis.h:30
CUDA_HOSTDEV void x2(const Vec3 &x2)
Set the third basis vecot.
Definition: Basis.h:55
void combine(cartesian_t &vec, cartesian_t &res)
Combine the basis with given weights.
Definition: Basis.h:79
CUDA_HOSTDEV void x0(const Vec3 &x0)
Set the first basis vector.
Definition: Basis.h:49
Simple class to store three-dimensional basis vectors.
Definition: Basis.h:15
CUDA_HOSTDEV const Vec3 & x2() const
Return third basis vector.
Definition: Basis.h:46