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 #48152] Fri, 31 March 2006 08:50 Go to previous message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
David Fanning <davidf@dfanning.com> writes:

> 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

David, I'm surprised you didn't refer to your own page, "Is Point
Inside Polygon?"

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

I've been using the algorithm you printed there by Krane for several
years and it works well. It is vectorized.

Craig

--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@REMOVEcow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
[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: Wed Oct 08 15:55:46 PDT 2025

Total time taken to generate the page: 0.00186 seconds