BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Polyline

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Graphics
View previous topic :: View next topic  
Author Message
Kriss
Guest





PostPosted: Mon Jun 14, 2004 6:08 am    Post subject: Polyline Reply with 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
willem van Deursen
Guest





PostPosted: Mon Jun 14, 2004 6:58 am    Post subject: Re: Polyline Reply with quote



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





PostPosted: Tue Jun 15, 2004 9:36 am    Post subject: Re: Polyline Reply with 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...
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





PostPosted: Wed Jun 16, 2004 1:10 pm    Post subject: Re: Polyline Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Graphics All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.