mIRC Home    About    Download    Register    News    Help

Print Thread
Using $tan, $cos and $sin in degrees #17382 30/03/03 12:43 AM
Joined: Mar 2003
Posts: 21
N
Nanaki Offline OP
Ameglian cow
OP Offline
Ameglian cow
N
Joined: Mar 2003
Posts: 21
I know, from my time at school, that the tangent of 45 = 0. However, upon //echo -a $tan(45), the result given is 1.619775. This is not wrong, but it is merely the answer in radians. I wish to know the answer in degrees.

Is there any way of working it out? Perhaps by using $calc and variables?

Thanks in advance,
Nanaki.

Re: Using $tan, $cos and $sin in degrees #17383 30/03/03 12:51 AM
Joined: Dec 2002
Posts: 3,138
C
Collective Offline
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 3,138
Quote:
tangent of 45 = 0

Actually it's 1.

$tan(45).deg

Re: Using $tan, $cos and $sin in degrees #17384 30/03/03 01:09 PM
Joined: Mar 2003
Posts: 21
N
Nanaki Offline OP
Ameglian cow
OP Offline
Ameglian cow
N
Joined: Mar 2003
Posts: 21
Heh, yeah, i dunno why I said that, i knew it was 0!

Although, try //echo -a $tan(45).deg .
It returns 1. Why?

Re: Using $tan, $cos and $sin in degrees #17385 30/03/03 03:34 PM
Joined: Jan 2003
Posts: 3,012
KingTomato Offline
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
Thats just it, it IS 1 not 0..


-KingTomato
Re: Using $tan, $cos and $sin in degrees #17386 30/03/03 08:52 PM
Joined: Mar 2003
Posts: 21
N
Nanaki Offline OP
Ameglian cow
OP Offline
Ameglian cow
N
Joined: Mar 2003
Posts: 21
There I go again...
I'm pretty sure i was taught 0, but i'm gonna shut up now.
Thanks.

Re: Using $tan, $cos and $sin in degrees #17387 31/03/03 05:20 AM
Joined: Dec 2002
Posts: 2,809
C
codemastr Offline
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 2,809
tan(45) = sin(45)/cos(45)

sin(45) = sqrt(2)/2
cos(45) = sqrt(2)/2

tan(45) = (sqrt(2)/2)/(sqrt(2)/2) = 1