Barycentric Coordinates in Equilateral Triangle

I have an equilateral triangle ABC with vertices (v1,v2,v3) in the cartesian system. Given a point P(x,y) inside of the triangle ABC I have to calculate the barycentric coordinates of point P.

I know that I have to calculate the two Areas in particular Area of triangle Pv1v2 and Area of Triangle Pv2v3 in order to find a, b, c of Point P.

My problem is in finding the height of the Triangle Pv2v3. I know the coordinates of the all the vertices described above. How can i find the Height of triangle Pv2v3 ?

• See formula (14) here – Intelligenti pauca Dec 6 '15 at 15:10
• If your triangle has one side parallel to the $x$ axis, then things get much easier. – Intelligenti pauca Dec 6 '15 at 15:27

The barycentric coordinates of $P$ are the three real numbers $s_1,s_2,s_3$ satisfying the vector equation $$s_1 v_1 + s_2 v_2 + s_3 v_3 = P$$ together with the real number equation $$s_1 + s_2 + s_3 = 1$$ Assuming that you are given the coordinates $v_i = (x_i,y_i)$, $i=1,2,3$, and the coordinates of $P$ which I will also write with a subscript as $P=(x_0,y_0)$, the vector equation breaks up into a pair of real number equations $$x_1 s_1 + x_2 s_2 + x_3 s_3 = x_0$$ $$y_1 s_1 + y_2 s_2 + y_3 s_3 = y_0$$ Together with the third equation $$s_1 + s_2 + s_3 = 1$$ you have a system of three linear equations in three unknowns $s_1,s_2,s_3$, which you can easily solve using matrices or elimination methods or whatever you learned in linear algebra.