From: "Sadik " <>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Deciding which side a numerically generated line you are on
Date: Sat, 17 Jan 2009 00:17:01 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 35
Message-ID: <gkr81t$im2$>
References: <gkr5ue$8b5$> <gkr7it$4s4$>
Reply-To: "Sadik " <>
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: 1232151421 19138 (17 Jan 2009 00:17:01 GMT)
NNTP-Posting-Date: Sat, 17 Jan 2009 00:17:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1666517
Xref: comp.soft-sys.matlab:512162

"Sadik " <> wrote in message <gkr7it$4s4$>...
> "Dale" <> wrote in message <gkr5ue$8b5$>...
> > I am looking at a number of functions of two variables (say x and y), and I am restricting my attention to x \in [-pi/2, pi/2] and y \in [-pi, pi].  Call this set S \subset R^2.  The problem is such that I really only want to look at some of the data in this subset of the plane.  I numerically generate some boundary curves that separate feasible (x,y) coordinates from infeasible ones (by solving a system of two equations in two unknowns), and I need to be able to decide if an arbitrary point in S is on one side or the other side of the numerically generated curve.  I have the points on the curve as a 2xn array, each column of which is a point (x,y) on the curve.  
> > 
> > Here is a link to what the boundary curves look like:
> >
> > 
> > The reason for why I need to do this is because on one side of my curve I can't compute a number of the quantities and if I try, I run into a slew of other numerical non-convergence issues due to the inherent infeasibility of points on that side of the line.
> > 
> > Any ideas?
> > 
> > Thanks,
> > Luke
> Hello Luke,
> Just for brainstorming purposes.
> You know that the power of a point inside a circle is negative. It is zero if it is on the boundary and it is positive if it is outside. This power is given by:
> F(x,y) = (x-xc)^2 + (y-yc)^2 - r^2
> for a circle of radius r centered at (xc,yc).
> Looking at the curves you have given, if you could use their equations in a similar manner, you could define the power of a point with respect to a given curve. Heuristically, I would expect to see negative power values in the upper right infeasible region with respect to the again upper right curve because the points are in the "interior" region of that curve.
> Just an idea. Hope it helps a bit.
> Thanks.

By the way, you have said that the curves are generated numerically. So if you wish, you could fit a polynomial to obtain such equations.

If you think of the simplest parabola y = x^2, then the power should be F = x^2-y
so that every point in the interior of the parabola will give negative values. Those on the parabola will give zero and the exterior points will yield positive values.