Can you help me understand barycentric coordinates visually?

61 Views Asked by At

This is my first question here so I'm sorry if it is not a well written/formatted one.

I love maths but I have always had a lot of trouble following long equations. It always helps me when visuals are involved. So, would it be possible to explain barycentic coordinates visually?

More specifically, I am finding the y coordinate (height) of an arbitrary point on a 3d triangle. I have come across this equation.

For triangle points A, B, C, and point P(x,y,z), x & z are known, find y.

Determinant = (Bz - Cz) * (Ax - Cx) + (Cx - Bx) * (Az - Cz)

Lambda1 = ((Bz - Cz) * (Px - Cx) + (Cx - Bx) * (Pz - Cz)) / Determinant

Lambda2 = ((Cz - Az) * (Px - Cx) + (Ax - Cx) * (Pz - Cz)) / Determinant

Lambda3 = 1 - Lambda1 - Lambda2

Py = Lambda1 * Ay + Lambda2 * By + Lambda3 * Cy