24#include <boost/geometry.hpp>
54 typename CoordinateType,
typename DegreeOrRadian = boost::geometry::degree,
55 class CoordinateSystem = boost::geometry::cs::polar<DegreeOrRadian>>
56class coordinate :
public boost::geometry::model::point<CoordinateType, 2, CoordinateSystem>
70 : boost::geometry::model::point<CoordinateType, 2, CoordinateSystem>(
radius,
phi)
78 constexpr CoordinateType
const&
radius()
const {
return this->
template get<0>(); }
84 constexpr CoordinateType
const&
phi()
const {
return this->
template get<1>(); }
90 void radius(CoordinateType
const& v) {
return this->
template set<0>(v); }
96 void phi(CoordinateType
const& v) {
return this->
template set<1>(v); }
109constexpr char coordinate_tag_name[]{
"spherical_coordinate"};
113constexpr char coordinate_array_tag_name[]{
"spherical_coordinates_array"};
121 typename CoordinateType,
typename DegreeOrRadian = boost::geometry::degree,
122 class CoordinateSystem = boost::geometry::cs::polar<DegreeOrRadian>>
123class coordinate :
public boost::geometry::model::point<CoordinateType, 3, CoordinateSystem>
137 constexpr coordinate(CoordinateType
const& radius, CoordinateType
const& theta, CoordinateType
const& phi)
138 : boost::geometry::model::point<CoordinateType, 3, CoordinateSystem>(radius, theta, phi)
146 constexpr CoordinateType
const&
radius()
const {
return this->
template get<0>(); }
152 constexpr CoordinateType
const&
theta()
const {
return this->
template get<1>(); }
158 constexpr CoordinateType
const&
phi()
const {
return this->
template get<2>(); }
164 void radius(CoordinateType
const& v) {
return this->
template set<0>(v); }
170 void theta(CoordinateType
const& v) {
return this->
template set<1>(v); }
176 void phi(CoordinateType
const& v) {
return this->
template set<2>(v); }
void phi(CoordinateType const &v)
Set phi value.
constexpr CoordinateType const & radius() const
Get radius value.
constexpr coordinate()=default
Default constructor.
constexpr coordinate(CoordinateType const &radius, CoordinateType const &phi)
Constructor that uses radius and phi values.
constexpr CoordinateType const & phi() const
Get phi value.
void radius(CoordinateType const &v)
Set radius value.
constexpr CoordinateType const & theta() const
Get theta value.
constexpr CoordinateType const & radius() const
Get radius value.
constexpr coordinate(CoordinateType const &radius, CoordinateType const &theta, CoordinateType const &phi)
Constructor that uses radius, theta, and phi values.
void radius(CoordinateType const &v)
Set radius value.
constexpr CoordinateType const & phi() const
Get phi value.
constexpr coordinate()=default
Default constructor.
void phi(CoordinateType const &v)
Set phi value.
void theta(CoordinateType const &v)
Set theta value.
Namespace for polar coordinates.
constexpr char coordinate_array_tag_name[]
Predefined tag name for array of coordinates.
constexpr char coordinate_tag_name[]
Predefined tag name for one coordinate.
Namespace for spherical coordinates.
Namespace for the radial coordinates.