7
$\begingroup$

I'm trying to learn about barycentric coordinates so after a Google search found this PDF file which didn't look too scary. I'm only on page 3 and getting confused so hope I can get help here...

A triangle has vertices $p_1$, $p_2$, $p_3$ and a barycentric combination of the three points takes the form $$p = up_1 + vp_2 + wp_3$$ where $$u + v + w = 1$$ It says p can be rewritten $$p=up_1 + vp_2 + (1 - u - v)p_3$$

Then it asks "How can we find the barycentric coordinates of a given point p?" The claim is that there are 3 equations and the following linear system is setup:

$$\begin{bmatrix}p_1&p_2&p_3\\1&1&1\end{bmatrix}\begin{bmatrix}u\\v\\w\end{bmatrix} = \begin{bmatrix}p\\1\end{bmatrix}$$ for the unknown $u,v,w$. The system is then solved using Cramer's rule:

$$A = \begin{vmatrix}p_1&p_2&p_3\\1&1&1\end{vmatrix}$$ $$A_1 = \begin{vmatrix}p&p_2&p_3\\1&1&1\end{vmatrix}$$ $$A_2 = \begin{vmatrix}p_1&p&p_3\\1&1&1\end{vmatrix}$$ $$A_3 = \begin{vmatrix}p_1&p_2&p\\1&1&1\end{vmatrix}$$

My 2 points of confusion: 1) Is there 3 equations as claimed? I can see $p = \dots$ and $u + v + w = 1$ which is 2 equations. 2) Cramer's rule uses determinants, i.e. a value linked to a square matrix. The coefficient matrix here is 2-by-3, not square. Can someone help me see what the author is doing here please?

$\endgroup$
  • 3
    $\begingroup$ Note that the $p_k$ in the PDF document are in boldface, signifying that they're vectors. If you take $\mathbf p_k=\begin{bmatrix}x_k\\y_k\end{bmatrix}$, where $x_k$ and $y_k$ are scalars, you do obtain a $3\times 3$ system... $\endgroup$ – J. M. is a poor mathematician Nov 11 '11 at 18:51
8
$\begingroup$

The system is 3x3, not 2x3; what's written there is shorthand for

$$\left[\begin{array}{ccc} p^1_x & p^2_x & p^3_x \\ p^1_y & p^2_y & p^3_y\\ 1 & 1 & 1\end{array}\right]\left[\begin{array}{c}u\\v\\w\end{array}\right] = \left[\begin{array}{c} p_x\\p_y \\1\end{array}\right].$$ It should be clear what the three equations are here and why they make sense. You can now solve for $u, v, w$ using Cramer's Rule, if you're so inclined, but I'd reduce the problem to two dimensions instead:

$$\left[\begin{array}{cc}p^1_x - p^3_x & p^2_x - p^3_x\\p^1_y - p^3_y & p^2_y - p^3_y\end{array}\right]\left[\begin{array}{c}u\\v\end{array}\right] = \left[\begin{array}{c} p_x - p^3_x\\p_y-p^3_y\end{array}\right],$$ and then invert the matrix on the left to get $$\left[\begin{array}{c}u\\v\end{array}\right] = \frac{1}{2A} \left[\begin{array}{cc} p_y^2-p_y^3 & p_x^3-p_x^2\\p_y^3-p_y^1 & p_x^1 -p_x^3\end{array}\right]\left[\begin{array}{c} p_x - p^3_x\\p_y-p^3_y\end{array}\right],$$ where $A$, half the determinant of the matrix, is the (signed) area of the triangle.

$\endgroup$
  • $\begingroup$ Very helpful, worked through it and makes sense. Thanks a lot. $\endgroup$ – PeteUK Nov 12 '11 at 9:49
  • $\begingroup$ By the way, when inverting the matrix to get to the last step, could you "just see" that it's determinant would be the same as the determinant of the 3x3 (or twice the signed area)? I've proven algebraically that it's true, but it's not something that jumped out at me. $\endgroup$ – PeteUK Nov 25 '11 at 11:06
  • 2
    $\begingroup$ There is a very useful geometric interpretation of the determinant: it is the area of the parallelogram (volume of the parallelepiped, in higher dimensions) whose sides are the vectors give by the rows (or, equivalently, columns) of the matrix. This is why it jumps out at me that the determinant of the 2x2 matrix is twice the signed area of the triangle. It's actually not obvious to me that this is also the determinant of the original 3x3 matrix. $\endgroup$ – user7530 Nov 25 '11 at 11:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.