20#include <shapes/Torus.hpp>
31 auto const z =
e_z * c_dist;
32 auto const r_vec = c_dist - z *
e_z;
33 auto const r = r_vec.
norm();
37 auto const dir_vec_norm = dir_vec / dir_vec.
norm();
38 vec = dir_vec_norm * std::abs(dist);
Vector implementation and trait types for boost qvm interoperability.
Utils::Vector3d e_z
Unit vector in z direction.
void calculate_dist(const Utils::Vector3d &pos, double &dist, Utils::Vector3d &vec) const override
Utils::Vector3d m_center
center of the shape.
double m_direction
direction -1: inside, +1 outside
double m_tube_rad
tube radius.
DEVICE_QUALIFIER constexpr T sqr(T x)
Calculates the SQuaRe of x.