Boost logo

Geometry :

Subject: Re: [geometry] Bounding box checked first?
From: Barend Gehrels (barend_at_[hidden])
Date: 2012-02-08 13:13:47


Hi Sebastian,

On 8-2-2012 11:20, Sebastian wrote:
> Do the functions "bool within()" (e.g. point in polygon) and "bool
> intersects()" (e.g. polygon with polygon) do any bounding box checks?

No.

Because we use models of a bare point. It can be any point. Same for
polygon, can be any (that is: fulfilling the concept). So they don't
bear a box with them, the box is not part of the concept.

Therefore in many use cases it is adviceable to check that yourself.
Boost.Geometry contains the primitives (box, envelope, within)

Regards, Barend


Geometry list run by mateusz at loskot.net