I am currently implementing a 2D skeleton system in C# with XNA, but got stuck in how I would rotate the bones around a skeleton's axis.
A basic algorithm that I have figured out already would involve, one part or another, manipulating the coordenates of the bone around the axis. I just cannot find the equation that would return these coordenates once provided an angle.
For example, if the bone's axis.X originally is -1 and its axis.Y -2 units away from the skeleton's axis' X and Y, then when the skeleton is rotated 90 degrees the X difference would become 2 and the Y, -1 (illustrated).
I'm certain the function I'm looking for would end something like this:
void rotateVector (Vector2 vectorToAnalyze, Vector2 axis, float currentAngle, float newAngle, out Vector2 result);
If there are already functions that do the job, then I wouldn't mind using them - I'm certain there's something in the Matrix class related to this, but I'm a bit overwhelmed by it. As much it really would be nice to learn how this whole deal rolls, the most important thing to me, simply, is to find a solution that works this way I intend.