Exact Two-Dimensional Integration inside Quadrilateral Boundaries

This paper shows how shift, add, scale, and multiply operations on a few small matrices can compute the integral of any 2D polynomial ƒ(x, y) within any specified quadrilateral boundaries, including nonconvex chevrons, bow-ties, and triangles. For applications such as antialiased rendering, compositing, anisotropic texture filtering, and high-contrast imagery, such quad-bounded integrals are usually approximated by sampling or dicing into small fragments, but the method presented here is exact. It may be suitable for hardware implementation, but is practical only for low-degree polynomials (e.g., N,M < 5) due to machine-precision limits and high cost O(N 3 M 3). Sample C++ source code is provided online. Extending the same method to tensors may be useful for higher-dimensional polynomials within a limited class of curved boundaries as well.