Finding other two vertices of a triangle from centroid and one vertex?

462 Views Asked by At

I am working on some gesture recognition for my game and I want to find if a point is inside the triangle created by the user or not. For that I need three vertices. Currently I am using the '$1 recogniser algorithm' which gives me the centroid and the first vertex. So how do I find the other two vertices using the centroid and one vertex?

1

There are 1 best solutions below

0
On

Let's suppose that the triangle is equilateral. Then the three sides are equal, as is the distance between the centroid $O$ and each of the vertices. The centroid coordinates are also the mean of the coordinates of the vertices.

This conditions should give you enough equations to compute the other vertices coordinates.

An other solution is to take the centroid as the center of the vector space, and take $OA$ ($A$ being the known vertex) as a basis. The other vertices you get woth a rotation of $\dfrac{2\pi}{3}$.