Path: news.mathworks.com!not-for-mail
From: "Roger Stafford" <ellieandrogerxyzzy@mindspring.com.invalid>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Distance between point and circular segment
Date: Tue, 22 Apr 2008 15:45:05 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 31
Message-ID: <ful161$rq7$1@fred.mathworks.com>
References: <4a2f4ac1-c21e-4ebf-8530-352f15098a47@41g2000hsc.googlegroups.com> <d122bed7-41d5-446a-8b0a-e786bdb938fb@a22g2000hsc.googlegroups.com> <fsrkeb$os2$1@fred.mathworks.com> <fsrvq5$5cu$1@fred.mathworks.com> <ft2m2v$gf5$1@fred.mathworks.com> <ft2rhd$pj5$1@fred.mathworks.com> <fukprj$6ih$1@fred.mathworks.com>
Reply-To: "Roger Stafford" <ellieandrogerxyzzy@mindspring.com.invalid>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1208879105 28487 172.30.248.37 (22 Apr 2008 15:45:05 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Tue, 22 Apr 2008 15:45:05 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1187260
Xref: news.mathworks.com comp.soft-sys.matlab:464555


"Laurent Huberty" <hubertyl@student.ethz.ch> wrote in message <fukprj$6ih
$1@fred.mathworks.com>...
> Hey, do you know how how you can find out if P is either on
> one or the other side of the line.
> 
> I ask because i wanna define a so called support polygon which
> is defined by 3 points X1, X2, X3 (3 footpoints)
> the Point P represents the horizontal projection of the
> center of gravity.
> The system is called stable if the point P is inside the
> support polygon and greater than 0. This means I first start
> to check the distances of the perpendicular to the vectors
> defined by X1,X2,X3 and than check if they are inside the
> polygon(triangle). The should be positive inside and
> negative outside
> 
> Laurent
-------------
  The point P = (x,y) lies inside triangle ABC, where A = (x1,y1), B = (x2,y2), 
and C = (x3,y3) if

 det([1 x y;1 x1 y1;1 x2 y2]),

 det([1 x y;1 x2 y2;1 x3 y3]), and

 det([1 x y;1 x3 y3;1 x1 y1])

all have the same sign.  Otherwise it lies outside.

Roger Stafford