30 #include "point_funcs.h"
31 #include "axisbox_funcs.h"
34 #include "quaternion.h"
45 _PolarToCart(d, m_elem);
54 _CartToPolar(m_elem, d);
60 Point<3>& Point<3>::polar(CoordType r, CoordType theta, CoordType z)
63 _PolarToCart(d, m_elem);
70 void Point<3>::asPolar(CoordType& r, CoordType& theta, CoordType& z)
const
73 _CartToPolar(m_elem, d);
80 Point<3>& Point<3>::spherical(CoordType r, CoordType theta, CoordType phi)
83 _SphericalToCart(d, m_elem);
89 void Point<3>::asSpherical(CoordType& r, CoordType& theta,
93 _CartToSpherical(m_elem, d);
100 Point<3>& Point<3>::rotate(
const Quaternion& q,
const Point<3>& p)
102 return (*
this = p + (*
this - p).rotate(q));
106 Point<3>& Point<3>::rotatePoint(
const Quaternion& q,
const Point<3>& p)
112 Point<3> Point<3>::toLocalCoords(
const Point<3>& origin,
113 const Quaternion& rotation)
const
115 return Point().setToOrigin() + (*
this - origin).rotate(rotation.inverse());
119 Point<3> Point<3>::toParentCoords(
const Point<3>& origin,
120 const Quaternion& rotation)
const
122 return origin + (*
this - Point().setToOrigin()).rotate(rotation);
125 template class Point<3>;
126 template class Point<2>;
128 template CoordType SquaredDistance<3>(
const Point<3> &,
const Point<3> &);
129 template CoordType SquaredDistance<2>(
const Point<2> &,
const Point<2> &);
131 template Point<3> Midpoint<3>(
const Point<3> &,
const Point<3> &, CoordType);
132 template Point<2> Midpoint<2>(
const Point<2> &,
const Point<2> &, CoordType);
134 template Point<3> Barycenter<3, std::vector>(
const std::vector<Point<3> > &);
135 template Point<3> Barycenter<3, std::vector, std::list>(
const std::vector<Point<3> > &,
const std::list<CoordType> &);
137 template Point<2> Barycenter<2, std::vector>(
const std::vector<Point<2> > &);
138 template Point<2> Barycenter<2, std::vector, std::list>(
const std::vector<Point<2> > &,
const std::list<CoordType> &);
140 template Vector<3>
operator-<3>(
const Point<3> &,
const Point<3> &);
141 template Vector<2>
operator-<2>(
const Point<2> &,
const Point<2> &);
143 template Point<3>
operator-<3>(
const Point<3> &,
const Vector<3> &);
144 template Point<2>
operator-<2>(
const Point<2> &,
const Vector<2> &);
146 template Point<3>&
operator-=<3>(Point<3> &,
const Vector<3> &);
147 template Point<2>&
operator-=<2>(Point<2> &,
const Vector<2> &);
149 template Point<3>
operator+<3>(
const Vector<3> &,
const Point<3> &);
150 template Point<2>
operator+<2>(
const Vector<2> &,
const Point<2> &);
152 template Point<3>
operator+<3>(
const Point<3> &,
const Vector<3> &);
153 template Point<2>
operator+<2>(
const Point<2> &,
const Vector<2> &);
155 template Point<3>&
operator+=<3>(Point<3> &,
const Vector<3> &);
156 template Point<2>&
operator+=<2>(Point<2> &,
const Vector<2> &);