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

Username:   Password: 
 RegisterRegister   
 SinCosTan (-1)
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
chrispaks




PostPosted: Thu Apr 14, 2005 5:30 pm   Post subject: SinCosTan (-1)

Ok we have the codes sin, sind, cos, cosd, tan, tand...etc...

If we have angle 50 and use cos (50) we will get 0.964966

What is the command (if there is any) to convert the 0.964966 into an angle (interger between 1-90)?

Note: I dont want to enter a ton of

if (variable) = 0.1028428
then
put "The degree is ##"

Instead, can Turing do the calculations for me?
Sponsor
Sponsor
Sponsor
sponsor
Martin




PostPosted: Thu Apr 14, 2005 6:19 pm   Post subject: (No subject)

Sure it can.

Your answer is in radians. There are 2 * pi radians in a circle. There are also 360 degrees in a circle.

This gives us that there are 360 degrees / 2 * pi radians

Now, we have how many radians there are, and we want to convert to degrees. Let the number of radians we have be x. We want to solve for how many degrees x is, which we'll denote by y.

y degrees / x radians = 360 degrees / 2 * pi radians.

Multiplying both sides by x we get:

y = (360 * x) / (2 * pi)
Andy




PostPosted: Thu Apr 14, 2005 7:12 pm   Post subject: (No subject)

err martin? what are ut alkin about?? hes looking for an inverse function.... yea they do exist.. its called arcsin arccos and arctan arc stands for arc length, meaning its in radians
lordofall




PostPosted: Thu Apr 14, 2005 9:20 pm   Post subject: (No subject)

i wish somebody told me this like last week cause my group messed up hard at a compsci contest since we didn't know about arctan :@ (ya we didn't finish math yet lol)
Martin




PostPosted: Fri Apr 15, 2005 6:08 am   Post subject: (No subject)

Andy wrote:
err martin? what are ut alkin about?? hes looking for an inverse function.... yea they do exist.. its called arcsin arccos and arctan arc stands for arc length, meaning its in radians


Ohh...right....
chrispaks




PostPosted: Fri Apr 15, 2005 3:01 pm   Post subject: (No subject)

Martin wrote:
Sure it can.

Your answer is in radians. There are 2 * pi radians in a circle. There are also 360 degrees in a circle.

This gives us that there are 360 degrees / 2 * pi radians

Now, we have how many radians there are, and we want to convert to degrees. Let the number of radians we have be x. We want to solve for how many degrees x is, which we'll denote by y.

y degrees / x radians = 360 degrees / 2 * pi radians.

Multiplying both sides by x we get:

y = (360 * x) / (2 * pi)


so if you had to put that in a code for me to copy and paste, which way would I put it in?


var y, x : real
const pi : 3.14 (forget if you have to have var name or not as in real)
get x
y = (360 * x) / (2 * pi)
put y
Andy




PostPosted: Fri Apr 15, 2005 3:31 pm   Post subject: (No subject)

omg read the posts you idiot
Martin




PostPosted: Sat Apr 16, 2005 5:04 am   Post subject: (No subject)

Umm, Andy...read the first post again...
Sponsor
Sponsor
Sponsor
sponsor
Martin




PostPosted: Sat Apr 16, 2005 5:06 am   Post subject: (No subject)

chrispaks wrote:
Martin wrote:
Sure it can.

Your answer is in radians. There are 2 * pi radians in a circle. There are also 360 degrees in a circle.

This gives us that there are 360 degrees / 2 * pi radians

Now, we have how many radians there are, and we want to convert to degrees. Let the number of radians we have be x. We want to solve for how many degrees x is, which we'll denote by y.

y degrees / x radians = 360 degrees / 2 * pi radians.

Multiplying both sides by x we get:

y = (360 * x) / (2 * pi)


so if you had to put that in a code for me to copy and paste, which way would I put it in?


var y, x : real
const pi : 3.14 (forget if you have to have var name or not as in real)
get x
y = (360 * x) / (2 * pi)
put y


Yep. Smile
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  [ 9 Posts ]
Jump to:   


Style:  
Search: