Boost logo

Geometry :

Subject: [ggl] Re: within() to return true if point is on border?
From: Denis Pesotsky (obey)
Date: 2011-04-11 08:40:22


Thanks, Arash, did like you said, still works: http://paste.kde.org/10642/
It was almost morning, my brain hurted :).

2011/4/11 Arash Partow <arash_at_[hidden]>:
> On 11/04/2011 10:50 AM, Denis Pesotsky wrote:
>>
>> Dirty solution: http://paste.kde.org/10392/
>> It works well, but slower that it could. Any nicer way?
>>
>
> The way you're going about it is pretty much the correct way, that said your
> point on line segment routine is very inefficient.
>
> The algorithm should be something like this (assuming orientation
> predicate):
>
> is point on line-segment(s1,s2) -> bool
> {
> ? if point not in aabb of s1 s2 then
> ? {
> ? ? ?return false
> ? }
>
> ? return (orientation of point to s1-s2 == collinear)
> }
>
> _______________________________________________
> ggl mailing list
> ggl_at_[hidden]
> http://lists.osgeo.org/mailman/listinfo/ggl
>


Geometry list run by mateusz at loskot.net