Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Do you use radians or degrees?  (Read 5722 times)

0 Members and 1 Guest are viewing this topic.

Cornstalks

  • Full Member
  • ***
  • Posts: 180
    • View Profile
    • My Website
Do you use radians or degrees?
« on: September 21, 2014, 10:07:24 pm »
SFML uses degrees. In my experience, it's the only thing that uses degrees (except for old, deprecated, and removed OpenGL stuff, which I ignore in this modern era).

I always use radians for things. Standard C and C++ trig functions take radians. OpenGL shader trig functions take radians. HLSL trig functions take radians. Whenever I do various geometric things I use radians. Honestly, the only time I ever "use" degrees is when I'm reporting them to the user; but even then I'm not really using radians; I'm just formatting the number as degrees for printing to screen. Whenever I actually use an angle, I use radians.

What about others? When do you use radians? When do you use degrees? How often do you need one or the other?

Side note: this isn't a "SFML should use radians" feature request, so I'm not looking to debate whether SFML should be radians/degrees. That kind of debate can happen in another thread. I'm trying to understand what users of SFML use, in real life.
« Last Edit: September 21, 2014, 10:11:27 pm by Cornstalks »

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Re: Do you use radians or degrees?
« Reply #1 on: September 21, 2014, 10:31:41 pm »
For game development, I use degrees. All the trigonometric operations are abstracted in Thor.Vectors so that I never have to convert anything. In fact, cases where I need to call sin, cos or atan2 directly have become extremely rare.

When talking about high-level logic, i.e. angles applied in geometric scenarios rather than pure mathematics, I find it much simpler and expressive to rotate something by 45 than by Pi/4, where Pi is a constant that requires another header.
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

Tex Killer

  • Full Member
  • ***
  • Posts: 242
    • View Profile
Re: Do you use radians or degrees?
« Reply #2 on: September 21, 2014, 10:38:46 pm »
The content code for my engine always uses angles as degrees. I think some time or another I have to use radians on my engine's internal code to compute some geometric stuff, but never on content code. Degrees are just easier to understand and to deal with, even though radians are a little easier to use on computations.

wintertime

  • Sr. Member
  • ****
  • Posts: 255
    • View Profile
Re: Do you use radians or degrees?
« Reply #3 on: September 22, 2014, 12:33:30 pm »
I think its best to try to avoid angles using vector math, because angles get nearly always fed to some trig. functions and only the result of these is needed. Doesn't apply here, but gimbal lock can be a problem sometimes.
If it cant be avoided then radians are better, because most libraries are using them (following one standard makes it less complicated and needs less unnecessary conversions or even double conversions that would reduce accuracy). They are also not any more difficult to understand than degrees for a programmer.

deathes

  • Newbie
  • *
  • Posts: 1
    • View Profile
    • Filmler
Re: Do you use radians or degrees?
« Reply #4 on: September 25, 2014, 02:16:24 pm »
I too use degrees for game development.