Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Help with tangents
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
CodeMonkey2000




PostPosted: Sat May 19, 2007 12:57 pm   Post subject: Help with tangents

Ok, my version of turing doesn't seem to support tangent functions. I checked in the turing help section, and it only has sin, sind, cos, cosd. I tried using arctan() but it doesn't seem to give me the correct number (I typed in 45, and it didn't give me 1). What do I do now? Is there a way around this? Sad
Sponsor
Sponsor
Sponsor
sponsor
richcash




PostPosted: Sat May 19, 2007 1:17 pm   Post subject: Re: Help with tangents

tan(x) = sin(x)/cos(x) Wink

[edit]Or sind(x)/cosd(x) for degrees obviously.
DIIST




PostPosted: Sat May 19, 2007 1:36 pm   Post subject: Re: Help with tangents

arctand finds the tan inverse in degrees. arctan finds the tan inverse in radians.
Try putting arctand(1), you'll get 45!
Wink
CodeMonkey2000




PostPosted: Sun May 20, 2007 8:17 pm   Post subject: Re: Help with tangents

Wow, thanks guys.

EDIT: ok, now I have another problem. How do I do sin/cos/tan inverse? What I was thinking was to search for the given ratio using sin/cos/tan of 1-360. This doesn't seem very practical, is there a better way?
Mazer




PostPosted: Sun May 20, 2007 9:20 pm   Post subject: RE:Help with tangents

thuvs already pointed out that arctan() is the inverse of tan(). Similarly, arccos() and arcsin() are the inverses of cos() and sin() respectively.
CodeMonkey2000




PostPosted: Mon May 21, 2007 1:28 pm   Post subject: RE:Help with tangents

My version of turing only has sin, cos, tan, arctan and arctand. arccos and arcsin don't exist.
DIIST




PostPosted: Mon May 21, 2007 2:15 pm   Post subject: Re: Help with tangents

Here

arcsin (x) = arctan (sqrt ((x *x) / (1 - (x *x))))
arccos (x) = arctan (sqrt ((1 - (x *x)) / (x *x)))

likewise:
arcsind (x) = arctand (sqrt ((x *x) / (1 - (x *x))))
arccosd (x) = arctand (sqrt ((1 - (x *x)) / (x *x)))

My version of turing dosnt have arcsind or arccosd either. But if you check f10 it will show you the equation for arcsin and cos. Bewary that you need to set limits on this function. For x = 0 and x= 1& -1. Another thing is to use abs, even though i didn't show it in my example you should because sqrt(-)=error Wink
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 7 Posts ]
Jump to:   


Style:  
Search: