|
-
Feb 11th, 2000, 03:24 AM
#1
Thread Starter
Junior Member
I'm currently designing a program to do some calculations including the tangent, sine and cosine. My problem is that the corresponding functions give an output in radials and I want it in degrees. How do I convert, and if that is not possible, how do I write my own function for calculating the tangent, sine and cosine?
------------------
Doomstar
http://come.to/Doomstar
-
Feb 11th, 2000, 04:16 AM
#2
Member
As I recall, 2*pi radians = 360 degrees, so if the answer is 1 radian then it is 180/pi degrees, etc...
-
Feb 11th, 2000, 04:28 AM
#3
This is a good explanation.
------------------
Boothman
There is a war out there, and it is about who controls the information, it's all about the information.
-
Feb 11th, 2000, 04:42 AM
#4
Thread Starter
Junior Member
Sorry, but I got something like -15 when I tried to calculate the tangent of 50 degrees.
I used this code to get to it:
pi = 4 * Atn(1)
a = tan(50) ' = -0.2719 radians
b = a * (180/pi)
Could you please tell me what I'm doing wrong?
-
Feb 11th, 2000, 05:56 AM
#5
Member
The input value for the tan() function is in radians, so
const pi as double = 3.1415926536 'or however precise you want it
tan(50*180/pi)=2.012...
--Carl
-
Feb 11th, 2000, 06:35 AM
#6
Thread Starter
Junior Member
I now know how to do it...
And I also found out I asked the wrong question. I meant, how do I use the Tan() function with in- and output in degrees.
Through some determination, luck and mostly your advice I discovered that it can be done like this:
pi = 4 * Atn(1)
a = Tan(50 * (pi /180))
this way a is the output in degrees (1.19...) and 50 the input in degrees.
Thanks for your help,
------------------
Doomstar
http://surf.to/Doomstar
-
Feb 11th, 2000, 11:43 AM
#7
Hyperactive Member
And it's name is radian, not radial.
-
Feb 11th, 2000, 01:38 PM
#8
Hyperactive Member
This is the kind of code I really want to get into. I want to use it for a graphics program I've been developing.Where can I find like tons of graphical formulas(or maybe even a couple of pounds)?
Thanks,
Joey O.
-
Feb 11th, 2000, 10:28 PM
#9
Thread Starter
Junior Member
hey Juan Carlos, I think you maybe could have figured out that I knew that after the first reply. changing the topic isn't possible, so I can't correct my stupid mistake.
as for joey, the site Boothman_7 mentioned ( http://math.usask.ca/readin/examples/rmoa_eg1.html ) could be a good one to visit. if I knew other sites to visit, I'd tell 'em, but I just don't. Sorry...
------------------
Doomstar
http://surf.to/Doomstar
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|