my problem consists of rotating a triangle around the T axis so that the point A faces the point P. The only known points are A, B, C and the T (the center of the triangle), look at the left figure below.
My question is how to make this transformation and have the new coordinates (x, y) of the 3 points (A,B,C) that form the triangle as in the right figure below :
EDIT:
VertexArray rotatedTri(Vector2f T,Vector2f P,Vector2f A,Vector2f B,Vector2f C)
{
VertexArray mtri(Triangles);
double s = atan2(P.y-T.y,P.x-T.x) - atan2(A.y-T.y,A.x-T.x);
double aX = P.x + cos(s) * (A.x-P.x) + sin(s) * (A.y - P.y);
double aY = P.y + sin(s) * (A.y-P.y) + cos(s) * (A.x - P.x);
double bX = P.x + cos(s) * (B.x-P.x) + sin(s) * (B.y - P.y);
double bY = P.y + sin(s) * (B.y-P.y) + cos(s) * (B.x - P.x);
double cX = P.x + cos(s) * (C.x-P.x) + sin(s) * (C.y - P.y);
double cY = P.y + sin(s) * (C.y-P.y) + cos(s) * (C.x - P.x);
mtri.append(Vector2f(aX,aY));
mtri.append(Vector2f(bX,bY));
mtri.append(Vector2f(cX,cY));
return mtri;
}

