rectint
Area of intersection of rectangles.
📝Syntax
out = rectint(A, B)
📥Input Arguments
Parameter Description
A an M-by-4 matrix; each row is a rectangle [x y width height].
B an N-by-4 matrix; each row is a rectangle [x y width height].
📤Output Arguments
Parameter Description
out an M-by-N matrix; out(i, j) is the area of the intersection of rectangle A(i, :) and rectangle B(j, :).
📄Description

rectint returns the area of intersection of rectangles. Each rectangle is given as a four-element row [x y width height], where (x, y) is a corner and width and height are the side lengths. Rectangles that do not overlap contribute a zero area.

💡Examples
area = rectint([0 0 1 1], [0.5 0.5 1 1])
🔗See Also
polyarea
🕔Version History
Version Description
2.0.0 Initial version.
Edit this page on GitHub