I like to do things "straight stick," so to speak. Try this stuff out to your heart's content.
Thing is, it's really simple to convert radians to degrees or degrees to radians.
Radians * 180/pi = degrees.
Degrees * pi/180 = radians.
Seems easier than remembering the spacial function name, to me.
(Typo corrected. I saw I was printing out the y angle twice at the end, as opposed to y and then z. Sorry. This works right.)
Just so you can see why these formulas hold, simple derivation.
Question: How many radians is 30 degrees?
Answer consists of simple algebra:
2pi / 360 = xradians / 30
Solve for xrad
xrad = 30 * pi/180
xrad = 0.5236 radians
Or the other way around. How many degrees is pi radians?
Answer:
2pi / 360 = pi radians / x
Solve for x (cross multiply)
2pi * x = 360 * pi radians
x degrees = pi radians * 180/pi
x = 180 degrees
Code: (Select All)
_Title "Test sine, cosine, arcsin, arccos functions"
Screen _NewImage(120, 35, 0)
Color 1, 7
Cls
pi = 3.141592653589793
1 Input "Enter x in degrees"; x
xRad = x * pi / 180
SinX = Sin(xRad)
CosX = Cos(xRad)
yrad = _Asin(SinX)
zrad = _Acos(CosX)
y = yrad * 180 / pi
z = zrad * 180 / pi
Print
Print "Angle input x = "; x
Print
Print "Sin(x) = "; SinX
Print "Cos(x) = "; CosX
Print
Print "ArcSin(Sin(x)) in radians = "; yrad, "ArcSin(Sin(x)) in degrees = "; y
Print "ArcCos(Cos(x)) in radians = "; zrad, "ArcCos(Cos(x)) in degrees = "; z
Print
Input "Continue or exit (x to exit) "; cont$
If cont$ = "x" Then End
Print
GoTo 1
End
Thing is, it's really simple to convert radians to degrees or degrees to radians.
Radians * 180/pi = degrees.
Degrees * pi/180 = radians.
Seems easier than remembering the spacial function name, to me.
(Typo corrected. I saw I was printing out the y angle twice at the end, as opposed to y and then z. Sorry. This works right.)
Just so you can see why these formulas hold, simple derivation.
Question: How many radians is 30 degrees?
Answer consists of simple algebra:
2pi / 360 = xradians / 30
Solve for xrad
xrad = 30 * pi/180
xrad = 0.5236 radians
Or the other way around. How many degrees is pi radians?
Answer:
2pi / 360 = pi radians / x
Solve for x (cross multiply)
2pi * x = 360 * pi radians
x degrees = pi radians * 180/pi
x = 180 degrees