 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Kriss Guest
|
Posted: Mon Jun 14, 2004 6:08 am Post subject: Polyline |
|
|
Hi,
I have several polylines drawn in a window, and when i click in this
window, i want to know what is the nearest polyline from this point.
Who knows about an algo to calculate the minimum distance from a point
to a polyline ?
Thanks in advance,
KS
|
|
| Back to top |
|
 |
willem van Deursen Guest
|
Posted: Mon Jun 14, 2004 6:58 am Post subject: Re: Polyline |
|
|
See the graphics faq (http://www.faqs.org/faqs/graphics/algorithms-faq/)
under 1.02 How to find distance between a point and a line.
Willem
Kriss wrote:
| Quote: | Hi,
I have several polylines drawn in a window, and when i click in this
window, i want to know what is the nearest polyline from this point.
Who knows about an algo to calculate the minimum distance from a point
to a polyline ?
Thanks in advance,
KS
|
--
Willem van Deursen, The Netherlands
[email]wvandeursen_nospam (AT) nospam_carthago (DOT) nl[/email]
replace _nospam@nospam_ for @ to get a valid email address
www.carthago.nl
|
|
| Back to top |
|
 |
Nils Haeck Guest
|
Posted: Tue Jun 15, 2004 9:36 am Post subject: Re: Polyline |
|
|
You can check each of the segments of the polyline in turn, which simplifies
it to finding the distance between a point and a line:
http://www.simdesign.nl/tips/tip001.html
You can optimise this by first finding roughly the segments that might be
near the point (using a box around the line segment).
Kind regards,
Nils Haeck
www.simdesign.nl
"Kriss" wrote in message news:40cd40db$1 (AT) newsgroups (DOT) borland.com...
| Quote: | Hi,
I have several polylines drawn in a window, and when i click in this
window, i want to know what is the nearest polyline from this point.
Who knows about an algo to calculate the minimum distance from a point
to a polyline ?
Thanks in advance,
KS
|
|
|
| Back to top |
|
 |
hongbin.fei Guest
|
Posted: Wed Jun 16, 2004 1:10 pm Post subject: Re: Polyline |
|
|
yes, it is easy!
--
best reguards.
hongbin.fei
--------------------------------------
Crystal Component - TCAD
http://www.codeidea.com
Developer Forum
http://bbs.codeidea.com
--------------------------------------
Crystal Component
Room 307#,TiaoXi Road Commerce Building
HuZhou, ZheJiang 313000
China
Phone: +86 572 7281888
Mobile: +86 (0) 13335721372
Email :webmaster (AT) codeidea (DOT) com
"Nils Haeck" <n.haeckno (AT) spamchello (DOT) nl> дÈëÓʼþ
news:40cec07d$1 (AT) newsgroups (DOT) borland.com...
| Quote: | You can check each of the segments of the polyline in turn, which
simplifies
it to finding the distance between a point and a line:
http://www.simdesign.nl/tips/tip001.html
You can optimise this by first finding roughly the segments that might be
near the point (using a box around the line segment).
Kind regards,
Nils Haeck
www.simdesign.nl
"Kriss" wrote in message news:40cd40db$1 (AT) newsgroups (DOT) borland.com...
Hi,
I have several polylines drawn in a window, and when i click in this
window, i want to know what is the nearest polyline from this point.
Who knows about an algo to calculate the minimum distance from a point
to a polyline ?
Thanks in advance,
KS
|
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|