This is machine translation

Translated by Microsoft
Mouse over text to see original. Click the button below to return to the English verison of the page.


Rectangle intersection area


area = rectint(A,B)


area = rectint(A,B) returns the area of intersection of the rectangles specified by position vectors A and B.

If A and B each specify one rectangle, the output area is a scalar.

A and B can also be matrices, where each row is a position vector. area is then a matrix giving the intersection of all rectangles specified by A with all the rectangles specified by B. That is, if A is n-by-4 and B is m-by-4, then area is an n-by-m matrix where area(i,j) is the intersection area of the rectangles specified by the ith row of A and the jth row of B.

    Note   A position vector is a four-element vector [x,y,width,height], where the point defined by x and y specifies one corner of the rectangle, and width and height define the size in units along the x and y axes respectively.

See Also

Introduced before R2006a

Was this topic helpful?