Store angles internally as radians
L0laapk3 opened this issue · comments
Prerequisite Checklist
- I searched for existing issues to prevent duplicates
- I searched for existing discussions on the forum to prevent duplicates
- I understand SFML's scope and believe the feature fits it
Describe your feature request here
It has been mildly bothering me that angles are internally stored as degrees instead of radians.
It makes more sense to store them internally in radians, since thats what hardware is optimized for. Rather than having to convert them to radians all the time, only to have to convert them back immediately after.
Especially now that in 3.0 angles are unit-aware with sf::Angle
, I don't see any reason to use degrees anymore.
Its a fairly trivial change and I'd be happy to PR it myself, but I suspect this is the kind of thing that needs to be discussed first ;)
Use Cases
transform.rotate(vector.angle())
API Example
No response
I've done the work so we can discuss pros/cons:
#2978
I'm open to this idea if it means fewer lossy conversions between degrees and radians. The fact that the standard library exclusively uses radians compels me to prefer radians. I can't imagine users noticing or caring what underlying representation we choose.
I can't imagine users noticing or caring what underlying representation we choose.
Well, no need to imagine, this issue is a proof 😄
On a more serious note, I agree that this is a good idea.