Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: POLY2CW  ???  what happened to it?
Date: Mon, 12 Nov 2007 05:57:47 +0000 (UTC)
Organization: University of Memphis
Lines: 59
Message-ID: <fh8q0r$pqi$1@fred.mathworks.com>
References: <fh8m9n$hcb$1@fred.mathworks.com> <fh8n8i$s4v$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1194847067 26450 172.30.248.38 (12 Nov 2007 05:57:47 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Mon, 12 Nov 2007 05:57:47 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 233092
Xref: news.mathworks.com comp.soft-sys.matlab:437028



"Steven Lord" <slord@mathworks.com> wrote in message
<fh8n8i$s4v$1@fred.mathworks.com>...
> 
> "Paul " <par@ceri.memphis.edu> wrote in message 
> news:fh8m9n$hcb$1@fred.mathworks.com...
> > I'm having trouble using
> > inpolygon
> >
> > and I need poly2cw to sort it out.
> >
> > Where is it?
> 
> POLY2CW is a function in Mapping Toolbox, but INPOLYGON
doesn't call POLY2CW 
> (at least not in R2007b, and not in previous versions as
far as I remember). 
> What version of MATLAB are you using, what trouble are you
experiencing with 
> INPOLYGON, and why do think you need POLY2CW to sort it out?
> 
> -- 
> Steve Lord
> slord@mathworks.com 
> 
> 

clear
close('all')

x1 = [1/4 1/2];
y1 = [1/2 3/4];
x2 = [1/2 3/4];
y2 = [1/4 1/2];

xv = [x1,x2];
yv = [y1,y2];




x = rand(1000,1);
y = rand(1000,1);

plot(xv,yv,'ro')

hold on
plot(x,y,'g.')

use = inpolygon(x,y,xv,yv);
plot(x(use),y(use),'r.')

%%%%%%%%%%%%%%%%%%%%%

you can see that when I merge the two segments of vertices,
then the area I want to isolate is not correct.   This is
basically what my problem is since I have two track of
particles and I want to isolate the region between them as
inside a polygon