Mapping Toolbox | ![]() ![]() |
Compute line or polygon intersection points.
Syntax
Description
[xi,yi] = polyxpoly(x1,y1,x2,y2) returns the intersection points of two sets of lines and/or polygons.
[xi,yi] = polyxpoly(...,'unique') returns only unique intersections.
[xi,yi,ii] = polyxpoly(...) also returns a two-column index of line segment numbers corresponding to the intersection points.
Example
[lat,lon]=extractm(usalo('state'),'california'); [lat,lon]=reducem(lat,lon); lat0 = 37; lon0 = -122; rad = 500; [latc,lonc] = scircle1(lat0,lon0,km2deg(rad)); usamap('california','lineonly') plotm(lat0,lon0,'r*') plotm(latc,lonc,'r') [loni,lati] = polyxpoly(lon,lat,lonc,latc); plotm(lati,loni,'bo')
scxsc
Compute the intersection points for pairs of small circles
See Also
crossfix |
Compute cross fix positions for bearings and ranges |
gcxgc |
Compute the intersection points between two great circles |
gcxsc |
Compute the intersection points between a great and a small circle |
navfix |
Perform mercator-based navigational fixing |
rhxrh |
Compute the intersection point between two rhumb lines |
scxsc |
Compute the intersection points for pairs of small circles |
![]() | polysplit | previewmap | ![]() |