Programmers - Do you prefer Degrees, or Radians?
Miscellaneous Forums/General Discussion/Programmers - Do you prefer Degrees, or Radians?
Hi all!
Just doing some quick research for Flow-
When coding with angles, What's your preference and why?
Personally I use Degrees, and can usually figure everything I want out from them, without having to drop to Radians, but I know some of you like to work in Radians.
Degrees. Easier to visualize, in my opinion. Also, I started using degrees long before I even learned about radians, so I'm more comfortable with the former.
Radians don't really help you find employment.
I've used degrees in the past, since they are usually much more human readable, but recently I realized something about radians that I'm surprised I haven't heard mentioned more:
If you declare a 2PI constant, it's really easy to define angles as x * 2PI, where x is a value between 0 and 1 indicating a rotation between 0 and 360 degrees. This way, 0.25 = 45 degrees, 0.50 = 180 degrees, 0.75 = 270 degrees, 1.00 = 360 degrees. I don't know about you, but this just makes a lot more sense to me, than a range like 0-360 which was chosen hundreds of years ago based on the approximate rotation of the earth around the sun in one day.
Consistency is everything for me. If I'm coding in C++ or C# I'd expect to use radians. If I'm coding in BlitzMax, I'd expect to use degrees.
I prefer degrees, but will use whatever I have to, or I'll force the use of degrees by any means necessary, seeing as how it's not exactly a complex process to convert to and from radians/degrees.
I would say radians, mainly for consistency but also for speed. Radian based trigonometric functions are built into the hardware.
Nevertheless, when thinking about graphics I tend to use degrees. They are certainly more natural from a human perspective.
There is no reason you have to pick one. If I were designing a language I would have functions for both, e.g. SinR( ) and SinD( ) for the sine function using radians or degrees. There would also be Sin( ), which could be either of these, but would default to SinR( ). In a language with function pointers, such as BlitzMax, all the trig functions Sin( ) , ATan( ) etc. could be switched to the radian or degree based functions.
I like Pi.
I prefer degrees, but will use whatever I have to, or I'll force the use of degrees by any means necessary, seeing as how it's not exactly a complex process to convert to and from radians/degrees.
Ditto. My strategy exactly.
I prefer the simpler the better, it has to stand the test of time. This test basically is if I come back to the code several months later and knackered from a busy day I still have to understand it in under a minute :)
When coding with angles, What's your preference and why?
Radians. Because they work beyond simple trigonometry.
The possibility to use both but if i have to choose then degrees.
Degrees because I'muse to them. Radians are more logical though.
I dont think Radians are more logical- unless you're talking about use in formulae-
Sounds like a Yes to Degrees. Thanks for your replies and reasons.
yeah that's what I mean.
I hated radians at school, so another vote for degrees here.
Degrees, since that is what I learned in school. But I really should internalize radians so I could use them without converting to degrees in my head.
It's all the same to me. I use what's appropriate for the language I am using.
Barney
Degrees are great!
360 is a fantastic number because so many number divide perfectly into it... It's pretty impressive.
Infact... From the Wiki
Another motivation for choosing the number 360 is that it is readily divisible: 360 has 24 divisors (including 1 and 360), including every number from 1 to 10 except 7. For the number of degrees in a circle to be divisible by every number from 1 to 10, there would need to be 2520 degrees in a circle, which is a much less convenient number.
Divisors of 360: 1, 2, 3, 4, 5, 6, 8, 9, 10, 12, 15, 18, 20, 24, 30, 36, 40, 45, 60, 72, 90, 120, 180, 360
wow that's a pretty impressive list of divisors!
Yes, because of the divisors it's incredibly easy to visuialise operations based on a circle, that's why I disagreed with you about the radians. :-)
Degrees.
All.
It's not like I'm having like thousands of lines like that in my stuff, probably only a few places. And I just adjust to the language I guess.. 0..2pi in QBasic, 0..360 in Blitz.
If you declare a 2PI constant, it's really easy to define angles as x * 2PI, where x is a value between 0 and 1 indicating a rotation between 0 and 360 degrees.
Well yeah, but if you make the constant equal 360 it works with degrees too.
degrees :)
Degrees for me as I prefer to think in integers as often as possible!
Another curious thing about radians is that common angles are (I assume) inexpressable in floating point - eg: PI*2 (probably) isn't exactly equal to '360 degrees' whereas '360' certainly is. Ditto I expect for '90 degrees' etc.
It's kind of moot since everything is converted to radians for the FPU, but it does mean that while I would trust this to do with I think it should...
For i#=0 To 360 Step 90
...I wouldn't trust this...
For i#=0 To PI2 Step PI2/4
I work in degrees - I have no use for Radians - not sure what they are - so they are irrelevent by default.
Let's be honest - you'd hardly say 'Todays' temperature is 80 Radians' - I mean that would be totally bent.
Radians for me, cos I think in Factoional parts of a semi Circle, but I would hazzard a guess that this is only because I was educated to a higher level of Maths than most.
That is for the latter five years of my maths education we simply didnt use Degree, so radians now seem more natural to me.
that would be totally bent.
I was thinking something about those lines when I read your comment.... :p
I think he meant burnt. 80 radians = 4600 degrees.
I think he meant burnt. 80 radians = 4600 degrees.
Nope dont think he did.
From Puki (Amongst lots)
it's less bent than cricket
it is totally bent at everything
The book thing is bent and gay though
that's because .fbx files are totally bent
etc
I think he meant burnt. 80 radians = 4600 degrees.
Spend several years talking to British folks. You'll figure out what it means.
Bent means screwed up right and Floyd made a funny joke right? That's all.
Degrees.
If my trig skills were more advanced then maybe radians would make more sense to me; but they're not, so they don't.
Degrees.
I know radians are probably better, but I never learned my irrational times tables.
Bent means screwed up right and Floyd made a funny joke right
I think we know that Puki isnt using it as that meaning
Bent- also means "Gay".
what's a radiant :P