Calling an X and Y co-ordinate system a Vector has always confused me... after all, X and Y is a rectangular form, or Cartesian plotted point. Vectors usually have a Direction, and Distance, force, power, whatever, therefore would be more of a Polar co-ordinate system than Cartesian.
In any case, I'm not going to argue about what you call it, nor ask to change it, that isn't my point of coming here.
So... to my point.
I've been working on a new class for what I'm working on. A form of Polar Co-ordinate system. Rather than being true Polar, the Y is inverted, so that Negative Y is up, rather than Positive Y being up, to corrispond to screen co-ordinates, rather than Graph type Co-ordinates. Also, 0 is measured from north, rather from east, to corrispond with sprite rotation in SFML.
Why use such a thing?
Say you're working on a 2D top down persective game. you have an X and a Y movement, but you want the sprite to face the direction of the movement. You'd need too calculate an angle.
No problem, Create a new Polar class object, pass it your X and Y vector co-ordinates, and it'll convert it into an angle (t) (t, because it is a secondary symbol to θ, and i don't think θ is C friendly, plus I have no idea how to type it, this was copied and pasted), and a radial (r)(its a radius co-ordinate).
You might want the oposite type of thing, a throwing game for example. you have a force and direction, and need to calculate an X and Y Vector for your sprite movement. again, no problem, create the Polar object, then use the conversion function to make a Vector from it.
Just a couple of examples.
So far, the class only has 4 functions.
Vector2f ToVector(), Creates a vector from the Polar
FromVector(Vector2f), Creates new Polar co-ordinate from a Vector
Rotate(float Angle), Increments t, then adds or subtracts 360 untill its in the 0 to <360 range
SetRotation(float Angle), Sets t, then puts it in the 360 range.
Then I thought... Why not share it? but not untill its finished.
I am plenty willing to share this code, though you could also say I'm kinda hopeful that you'd like the idea so much, you'd want to include it in the next version of SFML.
I'm also interested in what other functions you think might be useful.
Also, so far it uses floats only. I am a fan of doubles over floats, but the reason I didn't make it a template class is mostly because... well... any kind of int just wouldn't really work for this kind of thing.