7. Maths Radians

Radians

Welcome to Radians. Radians are a huge concept that really starts taking you into a new level of maths. Although, I personally find it rather simple. It is all about trigonometry. In fact it is the very core of trigonometry, only now we are going to see the whole picture.

Degrees and radians are two different units for measuring the same angle. A complete turn is 360 degrees, which is the same as 2PI radians.

Hence:

0 degrees = 0 radians

90 degrees = PI/2 radians

180 degrees = PI radians

270 degrees = 3PI/2 radians

360 degrees = 2PI radians

Converting Between Degrees And Radians

Now lets just take a look at converting Degrees to Radians and Radians back to Degrees.

To convert from Degrees to Radians:

Degrees * PI / 180

Also written as:

Degrees / 180 * PI

To convert from Radians to Degrees:

Radians * 180 / PI

Also written as:

Radians / PI * 180

This matters a lot in programming because the standard sin, cos and tan functions in C/C++ expect their angle in radians, not degrees. If you feed 90 straight into sin, the computer does not politely guess that you meant 90 degrees!

The Unit Circle

Now lets take a look at our Unit Circle from which trigonometry gets really useful:

Radian Circle

Lookie, a right angled triangle!

Now this is a unit circle, as you can see, it has a radius of 1 unit.

So lets start taking a look at how we can find point P on that diagram.

Using our lovely trigonometry:

cos(theta) = x / 1

therefore:

x = cos(theta)

!! We have our x position from our camera class in OpenGL !!

sin(theta) = y / 1

therefore:

y = sin(theta)

!! We have our y position from our camera class in OpenGL !!

And now you have your point P. Simple isn’t it.

Questions or corrections? If something doesn’t work or you spot something I’ve got wrong, leave a comment below. These tutorials have been around a long time, so useful corrections are always welcome!

  • March 25, 2010
  • 1