Re: Distance from point to box

From: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
To: Alexander Korotkov <aekorotkov(at)gmail(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Distance from point to box
Date: 2014-07-30 15:26:15
Message-ID: alpine.DEB.2.10.1407301719270.12870@sto
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2014-07-30 15:37:28 Re: [w32] test_shm_mq test suite permanently burns connections slots
Previous Message Tom Lane 2014-07-30 15:02:16 Re: Proposal to add a QNX 6.5 port to PostgreSQL