<p>Quadrilateral basis functions can be calculated using an outer product of the basis of two linear functions (1-r, r) and (1-s, s). The same thing does not apply for arbitrary $n$-sided domains. For this we use generalised barycentric coordinates. Wachspress coordinates are arguably the simplest generalised barycentric coordinates available, are fast to evaluate and are defined for arbitrary $n$.</p>

<p>For a point $p$ on a planar convex polygon defined by vertices $v_1, v_2, \ldots, v_n$, ordered counter-clockwise, you can find weights</p>

<p>$$w_i(p) = \frac{A(v_{i-1}, v_i, v_{i+1})}{A(v_{i-1}, v_i, p)A(v_{i}, v_{i+1}, p)}. $$</p>

<p>Here, $A(v_1, v_2, v_3)$ denotes the signed triangle area. The coordinate functions $\phi_i$ can then be found be normalising the weights $w_i(p)$</p>

<p>$$\phi_i(p) = \frac{w_i(p)}{\sum_{j=1}^n w_j(p)}.$$</p>

<p>Now, the coordinate functions correctly parametrise the point (linear reproduction property)</p>

<p>$$p = \sum_{i=1}^n v_i \phi_i(p).$$ </p>

<p>At vertices the coordinates satisfy the Lagrange property $\phi_i(v_j) = \delta_{ij},$ where $\delta_{ij}$ is the Kronecker delta, meaning that the corresponding coordinate function evaluates to 1 at its vertex and linearly interpolate on the edges. It is also important to notice that the coordinate partition unity $\sum_{i=1}^n \phi_i(p) = 1.$ </p>

<p>For, non-convex polygons you could use <a href="http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.104.6059&amp;rep=rep1&amp;type=pdf" rel="nofollow noreferrer">mean value coordinates.</a></p>

CC BY-SA 3.0
2018-01-24T20:30:34.333Z
Thanks for the answer. What happens to the weight function if p is one of the polygon vertices. The Ai triangle becomes a line with zero area? Also what do you mean by signed area?
ali
CC BY-SA 3.0
2018-01-24T20:59:56.930Z
I added a paragraph explaining what to do at the boundaries. For the signed triangle area consult [this.](http://demonstrations.wolfram.com/Signed2DTriangleAreaFromTheCrossProductOfEdgeVectors/)
Reynolds
CC BY-SA 3.0
2018-01-24T11:56:24.903Z
2018-01-24T20:58:42.627Z
2018-01-24T20:58:42.627Z
Reynolds
<p>Quadrilateral linear basis functions(generalized barycentric coordinates) are defined as:</p>

<p><a href="https://i.sstatic.net/OvNLJ.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/OvNLJ.png" alt="enter image description here"></a></p>

<p>What are the steps to calculate the above functions?</p>

<p>Is it possible to obtain basis functions for a 5 sided polygon(pentagon) or in general n-sided polygon? </p>

<transformations><interpolation>
How to obtain generalized barycentric coordinates for n-sided polygon?
ali
# How to obtain generalized barycentric coordinates for n-sided polygon?

(Asked by: username_0 on 2018-01-24)

Quadrilateral linear basis functions(generalized barycentric coordinates) are defined as:

[![enter image description here](https://i.sstatic.net/OvNLJ.png)](https://i.sstatic.net/OvNLJ.png)

What are the steps to calculate the above functions?

Is it possible to obtain basis functions for a 5 sided polygon(pentagon) or in general n-sided polygon?

**Tags:** transformations, interpolation


---

## 1 answers

### Answer by username_1 on 2018-01-24. Score: 3 | Accepted answer

Quadrilateral basis functions can be calculated using an outer product of the basis of two linear functions (1-r, r) and (1-s, s). The same thing does not apply for arbitrary $n$-sided domains. For this we use generalised barycentric coordinates. Wachspress coordinates are arguably the simplest generalised barycentric coordinates available, are fast to evaluate and are defined for arbitrary $n$.

For a point $p$ on a planar convex polygon defined by vertices $v\_1, v\_2, \ldots, v\_n$, ordered counter-clockwise, you can find weights

$$w\_i(p) = \frac{A(v\_{i-1}, v\_i, v\_{i+1})}{A(v\_{i-1}, v\_i, p)A(v\_{i}, v\_{i+1}, p)}. $$

Here, $A(v\_1, v\_2, v\_3)$ denotes the signed triangle area. The coordinate functions $\phi\_i$ can then be found be normalising the weights $w\_i(p)$

$$\phi\_i(p) = \frac{w\_i(p)}{\sum\_{j=1}^n w\_j(p)}.$$

Now, the coordinate functions correctly parametrise the point (linear reproduction property)

$$p = \sum\_{i=1}^n v\_i \phi\_i(p).$$

At vertices the coordinates satisfy the Lagrange property $\phi\_i(v\_j) = \delta\_{ij},$ where $\delta\_{ij}$ is the Kronecker delta, meaning that the corresponding coordinate function evaluates to 1 at its vertex and linearly interpolate on the edges. It is also important to notice that the coordinate partition unity $\sum\_{i=1}^n \phi\_i(p) = 1.$

For, non-convex polygons you could use [mean value coordinates.](http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.104.6059&rep=rep1&type=pdf)

> **Comments:**
> **username_0**: Thanks for the answer. What happens to the weight function if p is one of the polygon vertices. The Ai triangle becomes a line with zero area? Also what do you mean by signed area?  
> **username_1**: I added a paragraph explaining what to do at the boundaries. For the signed triangle area consult [this.](http://demonstrations.wolfram.com/Signed2DTriangleAreaFromTheCrossProductOfEdgeVectors/)  

---

