
15 Nov
2009
15 Nov
'09
9:11 a.m.
Hi Rutger, I still don't know if we understand each other.
Have you considered an approach looking like
distance( a, b, f ); angle( a, b, f );
where f would be a functor with the minimal required mathematical operation needed to perform the required set of geometric operations? E.g., a dot- product operator?
I believe it is implemented like you suggests. f is a strategy, doing the actual operation. It is optional, so: distance(a,b) -> the default operation, corresponding to coordinate system of a and b distance(a,b,f) -> you can override things, e.g. to call pythagoras for two lat long points Regards, Barend