Re: finding if point is inside irregular rectangle

new topic     » goto parent     » topic index » view thread      » older message » newer message

With help of your link I found this C code by searching for "inpoly.c" on
google:
http://www.math.iastate.edu/burkardt/c_src/orourke/inpoly.c

I translated it to Euphoria and it didn't work. I must have done something
wrong. Then I tested it in C++ by slightly modifying it to work with vector
arrays and it works.

Some C code is also here, I didn't test it:
http://www.ce.berkeley.edu/~doolin/code/jsystem/jointsystem.c.html

I read somewhere that you could sum all angles between all polygon vertices
and point. You would take two vertices from polygon and tested point and
make triangle from it. That sum should be 360 if point lies inside polygon.
That should also work.

----- Original Message -----
From: "Al Gonzalez" <alg at nomscon.com>
To: "EUforum" <EUforum at topica.com>
Sent: Monday, February 25, 2002 10:52 PM
Subject: RE: finding if point is inside irregular rectangle


>
> "far from trivial" maybe an understatement unless you are up on all of
> your geometry.
>
> Have a look here:
> http://www.acm.org/tog/resources/RTNews/html/rtnv5n3.html#art3
>
> There is some discussion and sample code in C
>
> gwalters at sc.rr.com wrote:
> > then it's a polygon...and it's far from trivial to find if a point is
> > inside.
> >
> > george
> > ----- Original Message -----
> > From: <tone.skoda at siol.net>
> > To: "EUforum" <EUforum at topica.com>
> > Sent: Monday, February 25, 2002 4:05 PM
> > Subject: Re: finding if point is inside irregular rectangle
> >
> >
> > > No I don't mean that. It can have angles which are not 90 degree.
> > >
> > > ----- Original Message -----
> > > From: <bensler at mail.com>
> > > To: "EUforum" <EUforum at topica.com>
> > > Sent: Monday, February 25, 2002 9:57 PM
> > > Subject: RE: finding if point is inside irregular rectangle
> > >
> > >
> > > > He means a rectangle that is not exactly horizontal and vertical.
It's
> > > > still a rectangle, but on an angle, like a diamond with 90 degree
> > > > corners.
> > > >
> > > > Chris
> > > >
> > > > Brian Broker wrote:
> > > > > Hate to be a stickler here but "irregular rectangle" sounds like
an
> > > > > oxymoron.  A rectangle is a four-sided polygon having all right
> > angles.
> > > > >
> > > > > Perhaps you mean "irregular quadrilateral"...
> > > > >
> > > > > -- BB
> > > > >
> > > > >
> > > > > tone.skoda at siol.net wrote:
> > > > > > Here's another problem: I need to find out if point lies inside
> > > > > > an irregular rectangle. Irregular rectangle has
> > > > > > 4 corners but they don't need to be 90 degree, although they can
> > still
> > > > > > be.
> > > > > >
> > > > > > Example of irregular rectangle:
> > > > >
> > > > >
>
>
>

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu