poly_poly_intersectΒΆ

poly_poly_intersect returns the intersections of two polylines.

rmXY_I1I2 = poly_poly_intersect(rmXY1, rmXY2)

Return Value

rmXY_I1I2 is a matrix with 4 columns:

Wert Bedeutung
rmXY_I1I2[1] x-coordinates of the intersections.
rmXY_I1I2[2] y-coordinates of the intersections.
rmXY_I1I2[3] Index of the datapoint in rmXY1 closest to the intersection.
rmXY_I1I2[4] Index of the datapoint in rmXY2 closest to the intersection.

It the two polylines to not cross the return value is 0.

Parameters

rmXY1

rmXY1 is a matrix with two columns with data points. rmXY1[;1] are x-coordinates and rmXY1[;2] are the y-coordinates.

rmXY2

rmXY2 is a matrix with two columns with data points. rmXY1[;2] are x-coordinates and rmXY2[;2] are the y-coordinates.

Example

def XYGetIntersection(hData1, hData2)
{
    rmXY1 = XYGetData(hData1);
    rmXY2 = XYGetData(hData2);
    rmXY_I1I2 = poly_poly_intersect(rmXY1, rmXY2);
    if (len(rmXY_I1I2) == 1) {
        return 0;
    }
    return rmXY_I1I2[;1,2];
}

See also

poly_poly_clip

id-222886