14 : radial(position_[0]), azimuthal(position_[1]), polar(position_[2]) {
19 return lhs.radial == rhs.radial && lhs.azimuthal == rhs.azimuthal && lhs.polar == rhs.polar;
29 std::array<float, 3>
getSpherical()
const {
return {{radial, azimuthal, polar}}; };
31 void set(std::array<float, 3>& position_) {
32 radial = position_[0];
33 azimuthal = position_[1];
53 void calculateCartesian() {
59 x = radial * std::cos(_a) * std::sin(_p);
60 y = radial * std::sin(_a) * std::sin(_p);
61 z = radial * std::cos(_p);
Position(std::array< float, 3 > &position_)
friend bool operator==(const Position &lhs, const Position &rhs)
void set(std::array< float, 3 > &position_)
std::array< float, 3 > getSpherical() const
std::array< float, 3 > getCartesian() const
void setCartesian(std::array< float, 3 > &position_)
Utility function to be used only during interpolation; this leaves spherical coordinates undefined.
friend bool operator!=(const Position &lhs, const Position &rhs)
constexpr float deg2radf(float deg) noexcept
Converts degrees to radians.