|
Post by mackrackit on Jul 21, 2008 5:35:05 GMT -5
Not really RB related, but I need to figure this out for an app I am working on. My calculator shows: COSINE of 2 in DEGREES = 0.99939082 COSINE of 2 in RADIANS = -0.41614683 A little more study of radians and found: COSINE of (2 / 57.29577951) in RADIANS = 0.99939082 But what I can not figure out how to do is: COSINE of 2 in DEGREES = -0.41614683
|
|
|
Post by Janet on Jul 21, 2008 10:24:18 GMT -5
From the LB Help File
This code works in both RB and LB, but slightly different numbers after the 7th decimal position.
Print Using("##.#########", Cos(2/57.29577951)) ' Cosine of 2 degrees Print Using("##.#########", Cos(2)) ' Cosine of 2 radians End
|
|
|
Post by mackrackit on Jul 21, 2008 11:12:32 GMT -5
Thanks Janet, What I am trying to figure out is how to convert the cosine of a number in degrees to radians. Radians to degrees is easy. Lets say we had a program that returned the result in degrees and not radians like LB and RB. How would I then convert that to radians? I am working on a UTM to LatLon converter. I was awake the day they taught us the world is not flat. I have just recently found out working on this the world is not round either. It is kinda EGG shaped. The math is making me look more and more like my avatar
|
|
|
Post by StefanPendl on Jul 21, 2008 14:55:35 GMT -5
From the LB/JB help file: function pi() pi = asn(1) * 2 end function
function rad2deg(num) rad2deg = 90 / asn(1) * num end function
function deg2rad(num) deg2rad = asn(1) / 90 * num end function These functions use the internal precision, so they are better then using a constant value.
|
|