unify style of geometric algorithms
For intersection angle computations, there is the IntersectionAngle
class which contains the algorithms, while for computeMagnitude
and computeDistance
they are inside the free functions. This should probably be unified.
The advantage of an "algorithm class" is that it can be used as driver in some other place, and is thus modifiable by inheritance and modification of specific details.
One solution could be to add a free function
template<class Geo1, class Geo2, class Intersection, class AngleEngine = IntersectionAngle>
ctype computeAngle(const Geo1& geo1, const Geo2& geo2, const Intersection& is)
{ return AngleEngine()(geo1, geo2, is); }
where the engine defaults to the standard engine. Similarly, we could put computeMagnitude
etc, also in "algorithm classes" and let the free functions have an additional template argument for the driver, with default.