SFML community forums

General => Feature requests => Topic started by: Kingdom of Fish on February 03, 2008, 08:13:40 pm

Title: Setting rotation with radians
Post by: Kingdom of Fish on February 03, 2008, 08:13:40 pm
Hi, I was wondering if you are planning to add functionality to set the rotation of a sprite using radians instead of degrees?
Title: Setting rotation with radians
Post by: Laurent on February 04, 2008, 02:11:39 am
Hum, no. This should be enough if you need it :
Code: [Select]
inline float RadToDeg(float Rad)
{
    return Deg / M_PI * 180.f;
}

sprite.SetRotation(RadToDeg(1.158f));
Title: Setting rotation with radians
Post by: Kingdom of Fish on February 04, 2008, 11:21:26 am
My original thought was that most libraries uses radians for rotation and that opengl did so too, which would mean you already did the conversion once... but looking at the code i noticed i was wrong.
Title: Setting rotation with radians
Post by: Laurent on February 04, 2008, 01:36:17 pm
Well, I don't think it makes much difference, as one can easily write and use DegToRad and RadToDeg functions.

I just wanted to use something "human-friendly" by default, so that you can write Sprite.Rotate(90) instead of Sprite.Rotate(M_PI / 2.f).
Title: Setting rotation with radians
Post by: Kingdom of Fish on February 05, 2008, 01:23:30 am
Well thats a good enough reason, I'm just in favor of options... more so then necessary probably.
Title: Setting rotation with radians
Post by: zarka on February 05, 2008, 09:03:21 pm
Quote from: "Laurent"
Well, I don't think it makes much difference, as one can easily write and use DegToRad and RadToDeg functions.

I just wanted to use something "human-friendly" by default, so that you can write Sprite.Rotate(90) instead of Sprite.Rotate(M_PI / 2.f).


but radians are more programmer friendly! :)
Title: Setting rotation with radians
Post by: Laurent on February 06, 2008, 01:47:49 am
I guess everyone has its own preference ;)
Title: Re: Setting rotation with radians
Post by: LanceJZ on March 29, 2014, 08:13:41 am
Well, I don't think it makes much difference, as one can easily write and use DegToRad and RadToDeg functions.

I just wanted to use something "human-friendly" by default, so that you can write Sprite.Rotate(90) instead of Sprite.Rotate(M_PI / 2.f).

Funny you should say that, as I find radian way more human friendly than degrees. I hate having to figure out degrees to radians and back. I love Pi, why the hate on pi? I'm actually annoyed that degrees is what sprite uses for rotation.
Just my thoughts on the matter.
Title: Re: Setting rotation with radians
Post by: Laurent on March 29, 2014, 08:34:11 am
Thanks for reviving a 6 year-old thread just to complain about something that will never change anyway.
Title: Re: Setting rotation with radians
Post by: Deathbeam on April 02, 2014, 09:20:09 pm
Thanks for reviving a 6 year-old thread just to complain about something that will never change anyway.
(y) Degrees 4ever
Title: Re: Setting rotation with radians
Post by: Cleroth on April 25, 2014, 09:04:56 am
The degrees are most likely converted to radians internally at some point anyway, hence why using radians could be benificial (but unlikely).
Title: Re: Setting rotation with radians
Post by: Hiura on April 25, 2014, 11:49:41 am
The degrees are most likely converted to radians internally at some point anyway, hence why using radians could be benificial (but unlikely).

beneficial? -> look up «premature optimization».
Title: Re: Setting rotation with radians
Post by: Nexus on April 25, 2014, 12:09:16 pm
This 6-year old thread has already been necromanced, there's no need to artificially keep it alive. I think it should be closed, no new arguments have been brought anyway.