# Barycentric coordinates in a triangle - proof

I want to prove that the barycentric coordinates of a point $P$ inside the triangle with vertices in $(1,0,0), (0,1,0), (0,0,1)$ are distances from $P$ to the sides of the triangle.

Let's denote the triangle by $ABC, \ A = (1,0,0), B=(0,1,0), C= (0,0,1)$.

We consider triangles $ABP, \ BCP, \ CAP$.

The barycentric coordinates of $P$ will then be $(h_1, h_2, h_3)$ where $h_1$ is the height of $ABP$, $h_2 \rightarrow BCP$, $h_3 \rightarrow CAP$

I know that $h_1 = \frac{S_{ABP}}{S_{ABC}}$ and similarly for $h_2, \ h_3$

My problem is that I don't know how to prove that if $P= (p_1, p_2, p_3)$

then $(h_1 + h_2 + h_3)P = h_1 (1,0,0) + h_2 (0,1,0) + h_3 (0,0,1)$

Could you tell me what to do about it?

Thank you!

## 2 Answers

I assume that you are familiar with affine subspaces and affine maps. Briefly, in case you are not: An affine map between vector spaces is a linear map plus a constant and affine spaces can always be thought of as vector spaces (move them to pass through the origin). The key observation is that each barycentric coordinate $h_i(P)$ depends affinely on $P$.

Let $T$ denote the plane containing the triangle $ABC$; it is an affine subspace of $\mathbb R^3$. You can extend the barycentric coordinates naturally to all of $T$, and they are affine functions $h_1,h_2,h_3:T\to\mathbb R$. (If you are outside the triangle, at least one of the barycentric coordinates is negative.)

An affine map from $T$ to any affine space is uniquely determined by its values at three points because $T$ is two dimensional. The sum of the barycentric coordinates is constant (as can be deduced from the fact that the sum is affine and the same at all corners of the triangle). Let this constant be $H$.

Now define $f:T\to\mathbb R^3$ by $$f(P)=\frac1H(h_1(P),h_2(P),h_3(P)).$$ It is easy to see that $f$ is affine. Again, we check the values of this affine map at three points: $f(A)=A$, $f(B)=B$ and $f(C)=C$. Therefore $f$ has to be identity on all of $T$. This means that $$(h_1(P)+h_2(P)+h_3(P))P=(h_1(P),h_2(P),h_3(P))$$ for all $P\in T$. In particular, this holds for all $P$ in the triangle.

• @Hagrid, the sum of barycentric coordinates, $H(P)=h_1(P)+h_2(P)+h_3(P)$ is an affine function (as a sum of affine functions). Therefore it is uniquely determined by its values at three points (since it's defined on something with dimension two). Now $H(A)=H(B)=H(C)$, so $H$ is actually a constant. – Joonas Ilmavirta Mar 2 '15 at 15:57
• @Hagrid, $H(A)$ is the height of your triangle, which I believe is $\sqrt{3/2}$. A sum of affine maps is an affine map and the zero map is a linear map. An affine map is constant if and only if the corresponding linear map is the zero map. Within the triangle, each barycentric coordinate is the distance from a line, which is affine. (When extended to the whole plane, it becomes a signed distance.) – Joonas Ilmavirta Mar 2 '15 at 16:06
• @Hagrid, for $H$ yes but for $f$ no. Any two affine maps that agree on three non-collinear points are equal. $H$ equals a constant map at such points so it is constant. $f$ equals the identity map (not the constant map!) at such points so it is identity. – Joonas Ilmavirta Mar 2 '15 at 16:08
• @Hagrid, sorry for the delay. You defined the barycentric coordinates to be the heights of the heights of the small triangles. I took that as a definition and worked with that. That differs from the usual definition by a factor (as we have seen), but it looks like a reasonable definition to me. – Joonas Ilmavirta Mar 7 '15 at 4:56
• @Hagrid, if your triangle is not equilateral, then the heights of triangles do not agree with barycentric coordinates up to scaling. It might be possible to show (with suitable assumptions) that $h$s satisfying the equation are a multiple of barycentric coordinates. That is an interesting question, but I think it should be asked as a separate question. – Joonas Ilmavirta Mar 7 '15 at 14:29

Let $A_i$ $\>(1\leq i\leq3)$ be the vertices of your triangle $\triangle$, and let $P=(p_1,p_2,p_3)$ be an arbitrary point of $\triangle$. Then the cartesian coordinates $p_i$ of $P$ satisfy $p_1+p_2+p_3=1$, and at the same time we can write $$P=p_1A_1+p_2A_2+p_3A_3\ ,$$ which says that the $p_i$ can be viewed as well as barycentric corrdinates of $P$ with respect to $\triangle$.

We now draw the normal $n_3$ from $P$ to the side $A_1A_2$ of $\triangle$. This normal will be orthogonal to $\overrightarrow{A_1A_2}=(-1,1,0)$ and to $s:=(1,1,1)$; the latter because $n_3$ lies in the plane of $\triangle$. It follows that $\overrightarrow{A_1A_2}\times s=(1,1,-2)$ has the proper direction. We now have to intersect $$n_3:\quad t\mapsto (p_1,p_2,p_3) +t(1,1,-2)$$ with the plane $x_3=0$ and obtain $t={p_3\over2}$. Therefore the distance from $P$ to $A_1A_2$ is given by $$h_3={p_3\over2}\sqrt{1+1+4}=\sqrt{3\over2}\>p_3\ .$$ The conclusion is that the barycentric coordinates of $P$ are not equal to the three heights in question, but only proportional to these.

• So the barycentric coordinates are $(\frac{h_1}{H}, \frac{h_2}{H}, \frac{h_3}{H})$? – Hagrid Mar 2 '15 at 16:17
• @Hagrid, yes, the usual barycentric coordinates are. Your definition seems to differ by a constant factor from the usual one, but it is still a reasonable definition. I commented this also under the other answer. – Joonas Ilmavirta Mar 2 '15 at 16:19
• Great, thanks a lot! – Hagrid Mar 2 '15 at 16:22