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!
 A: 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.
A: 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.
