Boost logo

Geometry :

From: Adam Wulkiewicz (adam.wulkiewicz_at_[hidden])
Date: 2019-09-02 16:14:51


Hi Egon,

W dniu 02.09.2019 o 13:33, Egon Schaal via Geometry pisze:
>
> Hello
>
> I'm trying to find an example for comparable_distance with strategy
> pythagoras. Is there an example of this feature?
>
This is the default strategy for cartesian PointLike geometries so you
don't have to pass it explicitly. It's enough to simply call, e.g.:

auto cd = bg::comparable_distance(cartesian_point,
                                   cartesian_multi_point);

If you really want to pass it (e.g. your geometries are not cartesian
geometries but you want to calculate cartesian comparable distance),
it'd look like this:

auto cd = bg::comparable_distance(point,
                                   multi_point,
bg::strategy::distance::pythagoras<>());

or

auto cd = bg::comparable_distance(point,
                                   multi_point,
bg::strategy::distance::comparable::pythagoras<>());

Internally comparable strategy will be used in both cases (so the latter
one).

Adam



Geometry list run by mateusz at loskot.net