# Integration of functions over geometries

**URL:** <https://discourse.julialang.org/t/integration-of-functions-over-geometries/81994>\
**Category:** Specific Domains\
**Tags:** question, fem, mesh\
**Created:** [May 31, 2022, 2:04pm UTC](https://discourse.julialang.org/t/integration-of-functions-over-geometries/81994 "2022-05-31T14:04:04Z")\
**Posts on this page:** 1\
**Showing post:** 10

<div class="post-metadata">

**Author:** ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)\
**Post date:** [May 31, 2022, 7:05pm UTC](https://discourse.julialang.org/t/integration-of-functions-over-geometries/81994/10 "2022-05-31T19:05:09Z")

</div>

> [@juliohm](#):
>
> More specifically, I am looking for formulas for bilinear integration over quadrangles and trilinear integration over hexahedron in terms of the vertex values f\_1, f\_2, f\_3, \ldots and their coordinates x\_1, x\_2, \ldots .

You can take a quadrangle or a hexahedron and easily map into into a hypercube by a [coordinate transformation](https://www.geometrictools.com/Documentation/PerspectiveMappings.pdf), at which point you can apply any quadrature rule for a hypercube (with a corresponding Jacobian factor), whether it is a simple first-order bilinear rule or a tensor product of Gaussian quadrature rules or an [adaptive quadrature](https://github.com/JuliaMath/HCubature.jl) scheme.

More generally, things like triangular domains can also be [converted to rectangles](https://discourse.julialang.org/t/2d-integration-over-non-rectangular-domain-using-cubature/2991/7) with a change of variables, and general polygons could be [decomposed into triangles](https://discourse.julialang.org/t/integral-of-a-function-inside-non-rectangular-domain/72132/9), etcetera.

---

_[View the full topic](https://discourse.julialang.org/t/integration-of-functions-over-geometries/81994)._
