comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: some geometry questions.
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: some geometry questions. [message #48174 is a reply to message #48170] Wed, 29 March 2006 15:56 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
qian writes:

> If I have 4 random points (x0,y0) (x1,y1), (x3,y3), (x4,y4), is there a
> simple way to decide whether one of them is inside of the triangle
> formed by the other three points?
>
> If none of them is in the triangle by others, how can I connect them in
> order to form a 4 edges polygon, instead of two head on triangles, when
> using order 1-2-3-4-1?
>
> like this:
> 1----2
> \ \
> 4\__\3
>
> not like this:
> 1-----2
> \ /
> /\
> / \
> 3-----4

You are looking for a "complex hull algorithm", such as this
one:

http://nms.csail.mit.edu/~aklmiu/6.838/convexhull/index.html

In IDL you can find the convex hull of a set of points
with the TRIANGULATE command:

http://www.dfanning.com/tips/convex_hull.html

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Corrected copy of Intro to IDL available
Next Topic: About iTools

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sun Oct 12 04:33:29 PDT 2025

Total time taken to generate the page: 1.76096 seconds