Boost logo

Boost :

Subject: Re: [boost] [GGL] Initial thoughts; how to register point types
From: Barend Gehrels (barend_at_[hidden])
Date: 2009-11-15 04:11:28


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


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk