SFML/SFML

Store angles internally as radians

L0laapk3 opened this issue · 3 comments

Prerequisite Checklist

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.