# matlab计算两个多边形的相交区域

matlab计算两个多边形的相交区域

## areaintersection.m

Function gives the approximate area of intersection of two polygons

whose vertices are given by set1 and set2.

Note that implementation of this function requires the standard Matlab

function "inpolygon"

STANDARD CALL

area = areaintersection(set1, set2, resolution)

INPUTS

set1 : an N x 2 matrix of the form (x1, y1; x1, y2; ...) giving the

vertices of a polygon

set2 : an M x 2 matrix of the form (x1, y1; x1, y2; ...) giving the

vertices of a second polygon

resolution : a positive scalar that determines the accuracy of the

approximation. The larger the value the greater the accuracy and the

longer the evaluation time. The matlab function "inpolygon" is the

real limiting factor in terms of execution time

OUTPUT

area : a scalar value that represents the area of intersection of the two

polynomials in standard units squared

Paul Koprowski 2007

paulkoprowski@hotmail.com

areaintersection.zip (1.13KB)

areaintersection.m