## Solution: Barycentric Coordinates

#### August Ferdinand Möbius

(1790 - 1868)

Möbius is credited with introducing barycentric coordinates in 1827. We'll discuss their relationship to center of mass in exercise (3) below.

(1)  Discuss and sketch values of the parametric equation  α+ βb

with the constraint
α + β = 1.

It is obvious that (
α=1, β=0) corresponds to  a.
(This can be thought of as a point in space or
as the tip of vector a from some origin in space.)
Also, (
α=0β=1) corresponds to  = b.

Therefore, varying parameter α (or β) slides us along the line connecting
the points a and b (that is, the line connecting the tips of a and b).

Another way to see this is to rewrite the parametric equation, using the constraint, as  x = a + β(a).
All of the previous conclusions are still true. We start at
a and slide along (a), the vector pointing
from
a to b. If β (and therefore α) is in the range [0,1], x is somewhere on the connecting line segment.
If
α and β are outside that range, x is still on the line, but outside the connecting line segment.

The sketch of this parametric line is included in the diagrams below. It corresponds to the blue γ=0 line
connecting points
a and b.

(2)  For the parametric equation  α+ β+γc  with  α + β + γ = 1,
discuss values of the
parameters that give vertices, edges and interior points of a triangle.

Assume the nontrivial case that the three points are not colinear and therefore define a triangle in a plane.

Similar to exercise (1) above, we can replace
α with (1 - β - γ) to get  xa + β(a) + γ(c a).
We can think of
a as a coordinate origin (and a vertex of the triangle), and (a) and (c a) as
two general coordinate axes (or two sides of the triangle).
Now that coordinates β and γ are unconstrained,
x spans the whole plane of the triangle.

It should be obvious that values of (
α,β,γ) given by (α=1,0,0), (0,β=1,0), and (0,0,γ=1) correspond to
the triangle vertices
a, b, and c.

We can use the results of exercise (1) to see about the triangle edges. When γ=0, we are reduced
exactly to exercise (1). Then (0≤
α≤1, 0≤β≤1, γ=0) corresponds to the edge connecting a to b.
By the same logic, (α=0, 0≤β≤1, 0≤γ≤1) corresponds to the edge connecting b to c and
(0≤α≤1, β=0, 0≤γ≤1) corresponds to the edge connecting a to c.

From the diagram above, we can see that the half-plane above the
β=0 line corresponds to β>0, the
half-plane left of
α=0 corresponds to α>0, and the half-plane right of γ=0 corresponds to γ>0.
The intersection of these three half-planes is the interior of the triangle, so (and again, we can see
this in the diagram above) the interior of the triangle corresponds to (0<
α<1, 0<β<1, 0<γ<1).
Outside the triangle, one of the parameters is greater than 1, which makes at least one other
parameter negative. We can draw these same conclusions another way:

How can we tell algebraically whether a point x is above the β=0 line or below it? What is different
between the points {
x1, x2, x3} and the points {x4, x5}? Notice that for the top three points
(
x-c)(a-c) has a CCW orientation, whereas for the bottom two points it has a CW orientation.
We can capitalize on that difference. Remember, if two bivectors in the same plane with the same
orientation are multiplied, we get a negative number. In our diagram,
(b-c)(a-c) has a CCW
orientation also, so multiplying by
(x-c)(a-c) for any x in the top half-plane is negative:

$\Large{\begin{array}{l}\left[ {\left( {{\bf{x}} - {\bf{c}}} \right) \wedge \left( {{\bf{a}} - {\bf{c}}} \right)} \right]\left[ {\left( {{\bf{b}} - {\bf{c}}} \right) \wedge \left( {{\bf{a}} - {\bf{c}}} \right)} \right]\,\,\,<\,\,\,0\\\\{\bf{x}}\,\,\, = \,\,\,\alpha {\bf{a}} + \beta {\bf{b}} + \gamma {\bf{c}}\,\,\, = \,\,\,\alpha {\bf{a}} + \beta {\bf{b}} + \left( {1 - \alpha - \beta } \right){\bf{c}}\\\,\,\,\,\,\,~~~\,\, \Rightarrow \,\,\,\,\,\,\,\,\,{\bf{x}} - {\bf{c}}\,\,\, = \,\,\,\alpha \left( {{\bf{a}} - {\bf{c}}} \right) + \beta \left( {{\bf{b}} - {\bf{c}}} \right)\\\\\left[ {\left\{ {\alpha \left( {{\bf{a}} - {\bf{c}}} \right) + \beta \left( {{\bf{b}} - {\bf{c}}} \right)} \right\} \wedge \left( {{\bf{a}} - {\bf{c}}} \right)} \right]\left[ {\left( {{\bf{b}} - {\bf{c}}} \right) \wedge \left( {{\bf{a}} - {\bf{c}}} \right)} \right]\,\,\,<\,\,\,0\\\\\left( {{\bf{a}} - {\bf{c}}} \right) \wedge \left( {{\bf{a}} - {\bf{c}}} \right)\,\,\, = \,\,\,0\,\,\,\,\,\,\,\, \Rightarrow \,\,\,\,\,\,\,\,\beta {\left[ {\left( {{\bf{b}} - {\bf{c}}} \right) \wedge \left( {{\bf{a}} - {\bf{c}}} \right)} \right]^2}\,\,\,<\,\,\,0\\\\{\left[ {\left( {{\bf{b}} - {\bf{c}}} \right) \wedge \left( {{\bf{a}} - {\bf{c}}} \right)} \right]^2}\,\,\,<\,\,\,0\,\,\,\,\,\,\,\, \Rightarrow \,\,\,\,\,\,\,\,0\,\,\,<\,\,\,\beta \end{array}}$

We've therefore proven that to be in the same half-plane as the triangle, we must have
0<β.
Using the same argument, we can show that we must also have
0<α and 0<γ. Yet, α + β + γ = 1,
and so again we find
the interior of the triangle corresponds to (0<α<1, 0<β<1, 0<γ<1).

The following is an interactive triangle to develop your intuition on barycentric coordinates. The
point
X can be grabbed and dragged by holding down the left mouse button. First, check the
conclusions above by moving
X to the triangle's vertices and to various points on the edges.

Theorem:  The fractional areas (ratio of subtriangle area to total triangle area) of the red, green, and blue
subtriangles in the interactive example above are equal to αβ, and γ, respectively.

You might convince yourself of the theorem by playing with the interactive triangle above. It is clear the three
subtriangular areas add up to the total. We'll use oriented wedge products to calculate the areas. If
X is outside
the triangle, you may have noticed one or two parameters are negative. It turns out, by adding
oriented areas,
the signed algebraic sum still adds correctly to the total positive area. Given (α,β,γ), we can calculate X from its
original defining equation. What if we knew
X and wanted to find the corresponding (α,β,γ)? It turns out the
answer to this question also gives us the ratios of subareas to total area we are after. There are various ways to
calculate them, but here's one way:

$\Large{\begin{array}{l}{\bf{x}}\,\,\, = \,\,\,\alpha {\bf{a}} + \beta {\bf{b}} + \gamma {\bf{c}}\,\,\,\,\,\,\,\,{\rm{and}}\,\,\,\,\,\,\,\,\alpha + \beta + \gamma = 1\,\,\,\,\,\,\,\, \Rightarrow \\~~~~~~~~{\bf{x}} - {\bf{a}}\,\, = \,\,\beta \left( {{\bf{b}} - {\bf{a}}} \right) + \gamma \left( {{\bf{c}} - {\bf{a}}} \right)\,\,\,\,\,\,{\rm{and}}\,\,\,\,\,\,{\bf{x}} - {\bf{b}}\,\, = \,\,\alpha \left( {{\bf{a}} - {\bf{b}}} \right) + \gamma \left( {{\bf{c}} - {\bf{b}}} \right)\\\\\\{\rm{Wedge\,\,\,\,the\,\,\,\,righthand\,\,\,\,equation\,\,\,\,on\,\,\,\,the\,\,\,\,left\,\,\,\,with\,\,\,\,}}\left( {{\bf{c}} - {\bf{b}}} \right):\\\\~~~~~~~~\alpha \,\,\, = \,\,\,\frac{{\left( {{\bf{c}} - {\bf{b}}} \right) \wedge \left( {{\bf{x}} - {\bf{b}}} \right)}}{{\left( {{\bf{c}} - {\bf{b}}} \right) \wedge \left( {{\bf{a}} - {\bf{b}}} \right)}}\,\,\, = \,\,\,\frac{{2\left( {{\rm{red\,\,\,\,CW\,\,\,\,subarea}}} \right)}}{{2\left( {{\rm{total\,\,\,\,CW\,\,\,\,area}}} \right)}}\\\\\\{\rm{Apply\,\,\,\,similar\,\,\,\,tricks\,\,\,\,to\,\,\,\,the\,\,\,\,lefthand\,\,\,\,equation\,\,\,\,to\,\,\,\,get:}}\\\\~~~~~~~~\beta \,\,\, = \,\,\,\frac{{\left( {{\bf{x}} - {\bf{a}}} \right) \wedge \left( {{\bf{c}} - {\bf{a}}} \right)}}{{\left( {{\bf{b}} - {\bf{a}}} \right) \wedge \left( {{\bf{c}} - {\bf{a}}} \right)}}\,\,\, = \,\,\,\frac{{2\left( {{\rm{green\,\,\,\,CW\,\,\,\,subarea}}} \right)}}{{2\left( {{\rm{total\,\,\,\,CW\,\,\,\,area}}} \right)}}\\\\\\~~~~~~~~\gamma \,\,\, = \,\,\,\frac{{\left( {{\bf{b}} - {\bf{a}}} \right) \wedge \left( {{\bf{x}} - {\bf{a}}} \right)}}{{\left( {{\bf{b}} - {\bf{a}}} \right) \wedge \left( {{\bf{c}} - {\bf{a}}} \right)}}\,\,\, = \,\,\,\frac{{2\left( {{\rm{blue\,\,\,\,CW\,\,\,\,subarea}}} \right)}}{{2\left( {{\rm{total\,\,\,\,CW\,\,\,\,area}}} \right)}}\end{array}}$

(3)  Discuss the relation of barycentric coordinates to center of mass.

Say the three points
a, b, and c in the triangle above have masses m1, m2, and m3 respectively and are
connected by massless, rigid rods. The position of the center of mass of that system is given by:

$\Large{{{\bf{X}}_{CM}}\,\,\, = \,\,\,\frac{{{m_1}{\bf{a}} + {m_2}{\bf{b}} + {m_3}{\bf{c}}}}{{{m_1} + {m_2} + {m_3}}}\,\,\, \equiv \,\,\,\alpha {\bf{a}}\,\, + \,\,\beta {\bf{b}}\,\, + \,\,\gamma {\bf{c}}}$

This is the same equation we started with for exercise (2). But there
(α,β,γ) were variable parameters
and here we're finding the center of mass of a system of three fixed masses. What's going on?

Well, let the masses be variable, then the center of mass can move around as those variables change.

In the interactive triangle above, when we move point
X to a place inside the triangle and we end up
with values for
(α,β,γ), we're saying that if we wanted that point to be the center of mass, we would
simply arrange for the relative masses to be
(α,β,γ).

If we think about supporting the triangle with a string attached to the ceiling at
X, then the barycentric
coordinates correspond to the required relative weights to keep the triangle balanced. Now we can even
see what it means to move
X below the β=0 line resulting in a negative β parameter. If we hung the
triangle with a string from that point (assuming a magical masseless frame to tie the string to), what
we're saying with the negative β parameter is that to balance the triangle we need another string tied
from the ceiling to point
b (negative weight).