Aceguy Posted April 17, 2009 Share Posted April 17, 2009 why doesnt tan(45)=1 [u]My Projects.[/u]Launcher - not just for games & Apps (Mp3's & Network Files)Mp3 File RenamerMy File Backup UtilityFFXI - Realtime to Vana time Clock Link to comment Share on other sites More sharing options...
Mat Posted April 17, 2009 Share Posted April 17, 2009 (edited) google tan(45) 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 April 17, 2009 by mdiesel AutoIt Project Listing Link to comment Share on other sites More sharing options...
nitekram Posted April 17, 2009 Share Posted April 17, 2009 (edited) why doesnt tan(45)=1cause it does not take degrees EDIT tan(45 degrees) = 1 Edited April 17, 2009 by nitekram 2¢ 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." From my dad "Do not worry about yesterday, as the only thing that you can control is tomorrow." WIKI | Tabs; | Arrays; | Strings | Wiki Arrays | How to ask a Question | Forum Search | FAQ | Tutorials | Original FAQ | ONLINE HELP | UDF's Wiki | AutoIt PDF AutoIt Snippets | Multple Guis | Interrupting a running function | Another Send StringRegExp | StringRegExp Help | RegEXTester | REG TUTOR | Reg TUTOT 2 AutoItSetOption | Macros | AutoIt Snippets | Wrapper | Autoit Docs SCITE | SciteJump | BB | MyTopics | Programming | UDFs | AutoIt 123 | UDFs Form | UDF Learning to script | Tutorials | Documentation | IE.AU3 | Games? | FreeSoftware | Path_Online | Core Language 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 Link to comment Share on other sites More sharing options...
monoceres Posted April 17, 2009 Share Posted April 17, 2009 For easy convertion between degrees and radians, look at the following functions in Math.au3 _Radian() _Degree() Broken link? PM me and I'll send you the file! Link to comment Share on other sites More sharing options...
Mat Posted April 17, 2009 Share Posted April 17, 2009 Why does everyone want to know about trig all of sudden? @Monoceres WOW! never noticed those, have been using rad * $pi/180 = deg AutoIt Project Listing Link to comment Share on other sites More sharing options...
Aceguy Posted April 17, 2009 Author Share Posted April 17, 2009 thanks guys.. i know 0/0 about trigernometry [u]My Projects.[/u]Launcher - not just for games & Apps (Mp3's & Network Files)Mp3 File RenamerMy File Backup UtilityFFXI - Realtime to Vana time Clock Link to comment Share on other sites More sharing options...
Mat Posted April 17, 2009 Share Posted April 17, 2009 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... AutoIt Project Listing Link to comment Share on other sites More sharing options...
Aceguy Posted April 17, 2009 Author Share Posted April 17, 2009 (edited) so tan(_Radian(45)) Edited April 17, 2009 by Aceguy [u]My Projects.[/u]Launcher - not just for games & Apps (Mp3's & Network Files)Mp3 File RenamerMy File Backup UtilityFFXI - Realtime to Vana time Clock Link to comment Share on other sites More sharing options...
monoceres Posted April 17, 2009 Share Posted April 17, 2009 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°= π/2180°= π/360°= 2πMore here. Broken link? PM me and I'll send you the file! Link to comment Share on other sites More sharing options...
Aceguy Posted April 17, 2009 Author Share Posted April 17, 2009 got it #include<math.au3> $ss=tan(_Radian(3))*54 ConsoleWrite($ss) will give me 2.83 i have a distance(54mm), and angle(3 degrees) and needed to know the rise.? [u]My Projects.[/u]Launcher - not just for games & Apps (Mp3's & Network Files)Mp3 File RenamerMy File Backup UtilityFFXI - Realtime to Vana time Clock Link to comment Share on other sites More sharing options...
UEZ Posted April 18, 2009 Share Posted April 18, 2009 (edited) got it #include<math.au3> $ss=tan(_Radian(3))*54 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 April 18, 2009 by UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now