Radians: Difference between revisions

From Legacy Roblox Wiki
Jump to navigationJump to search
>InvalidName
>NecroBumpist
Provide links to the math lib. Added syntax highlighting.
 
(37 intermediate revisions by 9 users not shown)
Line 1: Line 1:
{{EmphasisBox|<b>This article is about an advanced topic.</b>|red|dark=yes}}
This is a very basic explanation of [http://en.wikipedia.org/wiki/Radian Radians], if you have never been taught Radians before.
This is a very basic explanation of [http://en.wikipedia.org/wiki/Radian Radians], if you have never been taught Radians before.


Radians are another way of describing angles, as opposed to using degrees.  Something similar to Radians is used in everyday life, when we use fractions.  We say, "I want a third of a piece of cake," not, "I want 120 degrees worth of cake."
Radians are another way of describing angles, as opposed to using degrees.  Something similar to Radians is used in everyday life, when we use fractions.  We say, "I want a third of a piece of cake," not, "I want 120 degrees worth of cake."


For a basic idea of Radians to how much "cake" or "circle" you have, divide the radians by "2 pi". To convert how much "cake" or "circle" you have to Radians, multiply the "cake" (or circle) by "2 pi":
In this sense, we are using the concept of "[http://en.wikipedia.org/wiki/Turn_(geometry) turns]". There is one turn in a full circle, so 1 turn is 360&deg;. It follows that 180&deg; is half a turn, 90&deg; is a quarter turn, and so on.
 
==Conversion==
 
One turn is equal to 2{{pi}} radians. Therefore, 2{{pi}} radians = 360&deg;. From this, formulae for converting degrees to radians, and vice versa, can be found:
 
[[Image:Radians_to_Degrees.png]]
 
[[Image:Degrees_to_Radians.png]]
 
In Lua terms, these can be written as:


2pi => one whole circle<br>
{{lua|=
pi => one-half circle<br>
local radians = degrees * math.pi / 180
2pi/3 => one-third circle<br>
local degrees = radians * 180 / math.pi
pi/2 => one fourth circle<br>
}}
2pi/5 => one-fifth circle<br>
pi/3 => one-sixth circle<br>
2pi/7 => one-seventh circle <br>
pi/4 => one-eighth circle<br>
2pi/9 => one-ninth circle <br>
pi/5 => one-tenth circle <br>
2pi/11 => one-eleventh circle <br>
pi/6 radians => one-twelfth circle <br>
0 radians => No circle


[http://en.wikipedia.org/wiki/Degree_%28angle%29 Degrees] slice a circle into 360 parts -- and sometimes degrees need to be converted into Radians. To convert from degrees to radians, divide by (180/pi). To convert from radians to degrees, multiply by (180/pi)
However, there is a cleaner way of doing this. Lua provides functions to do these conversions for you in the math library:
{{lua|=
local inRadians = math.rad(degrees)
local inDegrees = math.deg(radians)
}}


For example:<br>
==Radians and Degrees==
360 Degrees => 2pi radians<br>
270 Degrees => 3pi/2 radians<br>
180 Degrees => pi radians<br>
90 Degrees => pi/2 radians<br>
60 Degrees => pi/3 radians<br>
45 Degrees => pi/4 radians<br>
30 Degrees => pi/6 radians<br>
0 Degrees => 0 radians<br>


== Advanced ==
For a basic idea of Radians to how much "cake" or "circle" you have, divide the radians by "2 pi".  To convert how much "cake" or "circle" you have to Radians, multiply the "cake" (or circle) by "2 pi":


The above examples have used whole numbers and rather clean fractions.  Unfortunately, if you want to make something like a "spiralling staircase", you will need to work with much finer "pie slices" than the ones above, and you will get decimals.  However, the principle and the computation is the same:
{|
! Angle in radians !! represents
|-
| 2{{pi}} || one whole circle
|-
| {{pi}} || one-half circle
|-
| 2{{pi}}/3 || one-third circle
|-
| {{pi}}/2 || one fourth circle
|-
| 2{{pi}}/5 || one-fifth circle
|-
| {{pi}}/3 || one-sixth circle
|-
| 2{{pi}}/7 || one-seventh circle
|-
| {{pi}}/4 || one-eighth circle
|-
| 2{{pi}}/9 || one-ninth circle
|-
| {{pi}}/5 || one-tenth circle
|-
| 2{{pi}}/11 || one-eleventh circle
|-
| {{pi}}/6 || one-twelfth circle
|-
| 0 || No circle
|}


For example:
[http://en.wikipedia.org/wiki/Degree_%28angle%29 Degrees] slice a circle into 360 parts -- and sometimes degrees need to be converted into Radians.  To convert from degrees to radians, divide by (180/pi).  To convert from radians to degrees, multiply by (180/{{pi}}). 


0 Degrees => 0 radians<br>
For example:<br>
1 Degree => 0.017453292519943295769236907684886 Radians<br>
{|
2 Degrees => 0.034906585039886591538473815369772 Radians<br>
! Angle in degrees !! represents
3 Degrees => 0.052359877559829887307710723054658 Radians<br>
|-
4 Degrees => 0.069813170079773183076947630739545 Radians<br>
| 360&deg; || 2{{pi}} radians
|-
| 270&deg; || 3{{pi}}/2 radians
|-
| 180&deg; || {{pi}} radians
|-
| 90&deg; || {{pi}}/2 radians
|-
| 60&deg; || {{pi}}/3 radians
|-
| 45&deg; || {{pi}}/4 radians
|-
| 30&deg; || {{pi}}/6 radians
|-
| 0&deg; || 0 radians
|}


And the reverse:<br>
== More info==
1 Radian => 57.295779513082320876798154814105 Degrees<br>
2 Radians => 114.59155902616464175359630962821 Degrees<br>
3 Radians => 171.88733853924696263039446444232 Degrees<br>
4 Radians => 229.18311805232928350719261925642 Degrees<br>


And so on.  You can convert Degrees to Radians and Radians to Degrees using [http://www.10ticks.co.uk/radianConverter.aspx online conversion tools], with your calculator, or with the following functions:
You can convert Degrees to Radians and vice versa using [http://www.10ticks.co.uk/radianConverter.aspx online conversion tools], with your calculator, or with the following members of the Lua [[Function_Dump/Mathematical_Functions|math library]]:


math.pi<br>
=== [[Function_Dump/Mathematical_Functions#math.rad(x)|math.rad(x)]] ===
Roblox reads this as Pi, which is 3.141592654.<br>


math.rad (x)<br>
Converts x (in degrees) into Radians. Example: math.rad(90) results in  1.5707963267949.
Converts x (in degrees) into Radians. Example: math.rad(90) results in  1.5707963267.<br>


math.degree (x)<br>
=== [[Function_Dump/Mathematical_Functions#math.deg(x)|math.deg(x)]] ===
Converts x (in Radians) into degrees. Example: math.rad(3.141592654) results in 360.<br>


== See Also ==
Converts x (in Radians) into degrees. Example: math.deg(3.1415926535898) results in 180.


[http://en.wikipedia.org/wiki/Radian Radians]
=== [[Function_Dump/Mathematical_Functions#math.pi|math.pi]] ===


[http://en.wikipedia.org/wiki/Degree_%28angle%29 Degrees]
Roblox reads this as Pi, which is 3.1415926535898.


[http://www.10ticks.co.uk/radianConverter.aspx Radian Degree Converter]
== See Also ==


[http://en.wikipedia.org/wiki/Table_of_polyhedron_dihedral_angles Table of polyhedron dihedral angles]
*[[Function_Dump/Mathematical_Functions]]
*[http://en.wikipedia.org/wiki/Radian Radians]
*[http://en.wikipedia.org/wiki/Degree_%28angle%29 Degrees]
*[http://www.10ticks.co.uk/radianConverter.aspx Radian Degree Converter]
*[http://en.wikipedia.org/wiki/Table_of_polyhedron_dihedral_angles Table of polyhedron dihedral angles]

Latest revision as of 20:54, 14 April 2012

This article is about an advanced topic.


This is a very basic explanation of Radians, if you have never been taught Radians before.

Radians are another way of describing angles, as opposed to using degrees. Something similar to Radians is used in everyday life, when we use fractions. We say, "I want a third of a piece of cake," not, "I want 120 degrees worth of cake."

In this sense, we are using the concept of "turns". There is one turn in a full circle, so 1 turn is 360°. It follows that 180° is half a turn, 90° is a quarter turn, and so on.

Conversion

One turn is equal to 2π radians. Therefore, 2π radians = 360°. From this, formulae for converting degrees to radians, and vice versa, can be found:

File:Radians to Degrees.png

In Lua terms, these can be written as:

local radians = degrees * math.pi / 180
local degrees = radians * 180 / math.pi

However, there is a cleaner way of doing this. Lua provides functions to do these conversions for you in the math library:

local inRadians = math.rad(degrees)
local inDegrees = math.deg(radians)

Radians and Degrees

For a basic idea of Radians to how much "cake" or "circle" you have, divide the radians by "2 pi". To convert how much "cake" or "circle" you have to Radians, multiply the "cake" (or circle) by "2 pi":

Angle in radians represents
2π one whole circle
π one-half circle
2π/3 one-third circle
π/2 one fourth circle
2π/5 one-fifth circle
π/3 one-sixth circle
2π/7 one-seventh circle
π/4 one-eighth circle
2π/9 one-ninth circle
π/5 one-tenth circle
2π/11 one-eleventh circle
π/6 one-twelfth circle
0 No circle

Degrees slice a circle into 360 parts -- and sometimes degrees need to be converted into Radians. To convert from degrees to radians, divide by (180/pi). To convert from radians to degrees, multiply by (180/π).

For example:

Angle in degrees represents
360° 2π radians
270° 3π/2 radians
180° π radians
90° π/2 radians
60° π/3 radians
45° π/4 radians
30° π/6 radians
0 radians

More info

You can convert Degrees to Radians and vice versa using online conversion tools, with your calculator, or with the following members of the Lua math library:

math.rad(x)

Converts x (in degrees) into Radians. Example: math.rad(90) results in 1.5707963267949.

math.deg(x)

Converts x (in Radians) into degrees. Example: math.deg(3.1415926535898) results in 180.

math.pi

Roblox reads this as Pi, which is 3.1415926535898.

See Also