Code covered by the BSD License  

Highlights from
Fast Quadrilateral Intersection

from Fast Quadrilateral Intersection by Russell
Computes the intersecting area of two arbitrary quadrilaterals.

polyLong2PolyShort(polyLong)
%Russell Cohen, 2009
%polyLong2PolyShort:
%converts a polygon in the [x y x y x y x .. ] format to the [x y; x y;
%...] format
function pts = polyLong2PolyShort(polyLong)
    x = polyLong(1:2:end)';
    y = polyLong(2:2:end)';
    pts = [x,y];
end

Contact us at files@mathworks.com