# Trigonometric functions

## Recommended Posts

why doesnt

`tan(45)`
=1

##### Share on other sites

tan(45) = 1.61977519

run a test in autoit you get exactly the same response.

you are probably asking the wrong question.

this is what you want...

```\$pi = 3.14159265358979323846264338327950288419716939937510
\$Result = Tan(45 * \$pi/180)
MsgBox (48, "Test2", \$Result)```

edited the code to include pi to 50 dec places, or else it returns 0.99999999

BINGO!!

1° = pi / 180 radians.

Note that Tan is "infinite" for ... -3PI/2, -PI/2, PI/2, 3PI/2, 5PI/2, ... and tends to return 1.63317787283838e+016 for such multiples of Pi-halves.

Edited by mdiesel

##### Share on other sites

why doesnt

`tan(45)`
=1
cause it does not take degrees

EDIT

tan(45 degrees) = 1

Edited by nitekram

All by me:

"Sometimes you have to go back to where you started, to get to where you want to go."

"Everybody catches up with everyone, eventually"

"As you teach others, you are really teaching yourself."

"Do not worry about yesterday, as the only thing that you can control is tomorrow."

Programming Tips

Excel Changes

ControlHover.UDF

GDI_Plus

Draw_On_Screen

GDI Basics

GDI_More_Basics

GDI Rotate

GDI Graph

GDI  CheckExistingItems

GDI Trajectory

Replace \$ghGDIPDll with \$__g_hGDIPDll

DLL 101?

Array via Object

GDI Swimlane

GDI Plus French 101 Site

GDI Examples UEZ

GDI Basic Clock

GDI Detection

# Ternary operator

##### Share on other sites

For easy convertion between degrees and radians, look at the following functions in Math.au3

_Degree()

Broken link? PM me and I'll send you the file!

##### Share on other sites

Why does everyone want to know about trig all of sudden?

@Monoceres

WOW! never noticed those, have been using

##### Share on other sites

thanks guys.. i know 0/0 about trigernometry

##### Share on other sites

0 divided by 0

the answer is as of yet, undefined, it could be anything except infinity...infinitys a silly number.

Maths mood in the holidays? What am i doing??!!!!

no probs, ace : any volounteers for making it even easier by making a TanD function?? shouldn't be too hard, just use tan with a conversion at the beginning...

so

Edited by Aceguy

##### Share on other sites

so is there a beter way....

tan(_degree(45)) or something.??

If you want to work with degrees that is the way to go.

However working with radians is much better since degrees is a retarded unit. Really.

90°= π/2

180°= π/

360°= 2π

More here.

Broken link? PM me and I'll send you the file!

##### Share on other sites

got it

```#include<math.au3>
ConsoleWrite(\$ss)```

will give me 2.83

i have a distance(54mm), and angle(3 degrees) and needed to know the rise.?

##### Share on other sites

got it

```#include<math.au3>
ConsoleWrite(\$ss)```

will give me 2.83

i have a distance(54mm), and angle(3 degrees) and needed to know the rise.?

Try this:

```\$c = 54 ;mm
\$alpha = 3 ;degrees
\$a = Sin(\$alpha / 180 * 3.1415926535897932384626) * \$c
\$b = Cos(\$alpha / 180 * 3.1415926535897932384626) * \$c

\$rise = \$a / \$b

MsgBox(0, "Math", \$rise)```

\$a and \$b are perpendicular to each other.

UEZ

Edited by UEZ

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

## Create an account

Register a new account

×

• Wiki

• Back

• Git