# Opengl in 500 lines barycentric calculation question

https://github.com/ssloy/tinyrenderer/wiki/Lesson-2-Triangle-rasterization-and-back-face-culling

I cannot figure out how we go from uAB-vector + vAC-vector + PA-vector = 0 to the linear system with those subscripts x and y? Is there another way of explaining how we take three vectors, split them into x and y type vectors, and produce a cross-product that can be used to find the barycentric coords (u, v, w)?

Also, I am not sure why there is a division by the z component of the cross product in last line of the barycentric function. Maybe the answer to my first question will make this more obvious.

Below is a picture of the section of the tutorial where I am stuck. Link to full page is above.

• This looks very similar to your previous question. Please edit your existing question to add additional information, rather than posting a new one that's nearly identical, leaving dead ends for future searchers. – DMGregory Jan 3 at 18:14
• Does this answer your question? What's the most efficient way to find barycentric coordinates? – Almo Jan 3 at 18:33
• @DMGregory my previous question is directed at how do we obtain u(AB-vector)+v(AC-vector)+PA-vector = 0-vector. I edited my previous question to remove the extra stuff that I would like to see addressed in this question. – Bluebomber357 Jan 3 at 19:41
• @Almo thank you for for that link, I will go over it. It looks like there are lots of ways to solve this problem, but I am very curious about the one in my linked article. – Bluebomber357 Jan 3 at 19:46