Reading through all your posts, you kinda never really explain what sort of behaviour you want. Everything you say is really confusing. Perhaps you should just start over, draw a simple diagram and let us know what you want to do.
This is not a programming problem, it's a maths problem.
Well, I believe I already stated quite clearly that I have drawn this out many times over. If you need a diagram, I can provide one. I took the time to draw this up in GIMP:
Given an object centered at point A, and given a point B, determine Theta, or what rotation an object centered at A would need in order to face B.
My solution was the arctangent of D over C, plus compensation for quadrant and special cases. However, I learned about atan2() which does quadrants, division, and special cases for you, which is why I'm using it. I then multiply my solution by 180 over PI in order to convert to degrees.
I expect to get back theta in degrees. I then expect this rotation be set for an object centered at A, causing it to face B.
If the following function should be doing this, that means the bug is elsewhere in my code. An explanation of why I'm doing it wrong, or a clarification that it should be working are both useful to me.
float angleBetweenVectors(sf::Vector2f a, sf::Vector2f b)
{
return 57.2957795f * atan2(b.y - a.y, b.x - a.x);
}
If you need me to clarify anything, or if you have any additional questions, just say so.