So the calculation should be
green.center.x = triangle.center.x + 200 * cos( theta );
green.center.y = triangle.center.y + 200 * sin( theta );
where theta
is the current rotation angle of the triangle. This assumes that theta == 0
has the triangle pointing to the right. If the 0
angle has the sprite pointing down, then I think you need to subtract M_PI_2
, e.g.
green.center.x = triangle.center.x + 200 * cos( theta - M_PI_2 );
green.center.y = triangle.center.y + 200 * sin( theta - M_PI_2 );