COMPGROUPS.NET | Search | Post Question | Groups | Stream | About | Register

### polyxpoly

• Email
• Follow

```I just started to use the mapping toolbox. Can anyone help me with
the cryptic polyxpoly? Suppose I have two line segments:
x1 = [0;1;2]'; y1 = x1;
x2 = x1; y2 = [2;1;0]';
Obviously, the two line segments [x1,y1] and [x2,y2] intercept at
point (1,1), but the MATLAB polyxpoly
[x,y,ii] = polyxpoly(x1,y1,x2,y2) gives the cryptic
x =
1
1
1
1
y =
1
1
1
1
ii =

1 1
1 2
2 1
2 2

Thanks.

Junchang
```
 0
Reply jju (2) 3/18/2005 3:10:06 AM

See related articles to this posting

```Junchang Ju wrote:
>
>
> I just started to use the mapping toolbox. Can anyone help me with
> the cryptic polyxpoly? Suppose I have two line segments:
> x1 = [0;1;2]'; y1 = x1;
> x2 = x1; y2 = [2;1;0]';
> Obviously, the two line segments [x1,y1] and [x2,y2] intercept at
> point (1,1), but the MATLAB polyxpoly
> [x,y,ii] = polyxpoly(x1,y1,x2,y2) gives the cryptic
> x =
> 1
> 1
> 1
> 1
> y =
> 1
> 1
> 1
> 1
> ii =
>
> 1 1
> 1 2
> 2 1
> 2 2
>
> Thanks.
>
> Junchang

That's the due to the algorithm used by the function.
Use
[x,y,ii] = polyxpoly(x1,y1,x2,y2,'unique')
to get only one point

hth
Jos
```
 0