Re: Distance from point to box - Mailing list pgsql-hackers

From Fabien COELHO
Subject Re: Distance from point to box
Date
Msg-id alpine.DEB.2.10.1407301719270.12870@sto
Whole thread Raw
In response to Re: Distance from point to box  (Alexander Korotkov <aekorotkov@gmail.com>)
Responses Re: Distance from point to box  (Alexander Korotkov <aekorotkov@gmail.com>)
List pgsql-hackers
>> ISTM that you miss the projection on the segment if dx=0 or dy=0.
>
> I don't need to find projection itself, I need only distance. When dx = 0
> then nearest point is on horizontal line of box, so distance to it is dy.
> Same when dy = 0. When both of them are 0 then point is in the box.

Indeed. I thought that the box sides where not parallel to the axis, but 
they are. So I do not see why it should be more complex. Maybe they is a 
general algorithm which works for polygons, and they use it for boxes?

-- 
Fabien.



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Proposal to add a QNX 6.5 port to PostgreSQL
Next
From: Robert Haas
Date:
Subject: Re: [w32] test_shm_mq test suite permanently burns connections slots