Domanda

Consider an in-plane Triangle (Black) with 3 edge points, (1,2,3). The area of this triangle is considered to be A. Then for an arbitrary point inside the triangle and connecting this point to each edges, we will have 3 small triangles, (Areas A12 , A23, A13). If I know the area ratios between the big and small triangles as :

  • n1 = A12 / A
  • n2 = A23 / A
  • n3 = A13 / A

I want to find the position of the arbitrary point (x0,y0).


*note : given three edges of a triangle, the area can be calculated as: (x1,y1) , (x2,y2) , (x3,y3)

A = 0.5 * det([x1 y1 1 ; x2 y2 1 ; x3 y3 1]);

È stato utile?

Soluzione

This can be simply solved with the barycentric coordinates. Given a point p and the triangle points t1, t2, t3, the point p can be expressed as

p = s1 * t1 + s2 * t2 + s3 * t3

where s1-s3 are the barycentric coordinates. Those can be interpreted as the relative area of the triangle opposite to the triangle point. And this is exactly what you are given with n1-n3.

So you can calculate your arbitrary point with the above formula.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top