maestro Posted July 28, 2010 Share Posted July 28, 2010 Hi, I'm currently writing a program that requires based on opposite and adjacent numbers. -opposite = 10 -adjacent = 10Now the problem is, I'm not sure how to put "Tan θ = 10/10" into AutoIT,it needs to find the Angle for that equation.Someone please help,Thanks. Hello, World!... LAME lol Link to comment Share on other sites More sharing options...
maestro Posted July 28, 2010 Author Share Posted July 28, 2010 Doesn't any one know... >< PLEASE! Hello, World!... LAME lol Link to comment Share on other sites More sharing options...
water Posted July 28, 2010 Share Posted July 28, 2010 (edited) Did you search the forum? There are a lot of UDFs available with mathematical functions.BTW: Wait at least 24 hours before bumping a thread! This is no 24 hours support forum. Please have look at the FAQ! Edited July 28, 2010 by water My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
water Posted July 28, 2010 Share Posted July 28, 2010 Have a look at this UDF. My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
maestro Posted July 28, 2010 Author Share Posted July 28, 2010 I'm confused as to which part of that will get me the value of the angle base on adjacent / opposite. If it helps, my script looks like this. $DesX = ;A number $DesY = ;A number $DisX = $Pxa - $DesX $DisY = $Pya - $DesY $Angle = Tan() $DisY / $DisX MsgBox (0,"Angle",$Angle) And I just need to find out how to write in that equation, or at least be able to have some other form of getting the same answer. Thanks. Hello, World!... LAME lol Link to comment Share on other sites More sharing options...
maestro Posted July 28, 2010 Author Share Posted July 28, 2010 (edited) This is just a bump because its now daytime, and hopefully I will get more replies. And I will add in here that this is a Right Angle triangle, I have any side I need (easiest are the opposite and adjacent) _____10_____ \ | | \ 90-| \ | \ | \ | 10 \ | \ __| \/ | <- is the angle I need. \ | \ | \| In my above post I show the equation I have. Can some one help me please, Thanks. Edited July 28, 2010 by maestro Hello, World!... LAME lol Link to comment Share on other sites More sharing options...
Developers Jos Posted July 28, 2010 Developers Share Posted July 28, 2010 (edited) This is just a bump because its now daytime, and hopefully I will get more replies.No it is NOT ok.You aren't here that long but it is the second time I am having to deal with you... Now either be patient and stick to one thread per subject and legitimate topics only or simply move on... clear? Edited July 28, 2010 by Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted July 28, 2010 Moderators Share Posted July 28, 2010 (edited) maestro, Firstly, which part of water's comment: Wait at least 24 hours before bumping a thread! This is no 24 hours support forumdid you not understand? Secondly, how insulting did you mean to be with: because its now daytimeWhere I am it is getting dark - your neck of the woods (western United States would be my guess ) is not the limit of the known world, you know. Finally, Now the problem is, I'm not sure how to put "Tan θ = 10/10" into AutoITThis is one way to do it: MsgBox(0, "Well look here!", "Tan θ = 10/10") but I am fairly sure that is not what you meant, so would you like to make your question clearer? You might get more responses then. Over to you. M23 Edit: Aha, pissed off more than just me! "Way to go" as you would probably say! Edited July 28, 2010 by Melba23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
maestro Posted July 28, 2010 Author Share Posted July 28, 2010 (edited) First off, sorry to whoever I offended, was not intentional. For clarification as Melba23 suggested. What I'm looking for is: If I have the values of 2 distances in an right angle triangle, distance 1 being the opposite, and distance 2 being the adjacent, (these 2 are variables) what would I have to type in to get the angle. Now I know the equation needs to be something like: $Angle = Tan() = distance 1 / distance 2 that way the output "$Angle" is the angle found by the math operation. The MsgBox is simply to display my results, so the MsgBox in the end will be ether commented out, or just straight deleted. Because what I need is the resulting angle of that operation. Thanks. Edited July 28, 2010 by maestro Hello, World!... LAME lol Link to comment Share on other sites More sharing options...
BuckMaster Posted July 28, 2010 Share Posted July 28, 2010 I think this is what you want.. Autoit automatically uses radians so you have to convert it. $Opposite = 10 $Adjacent = 10 dim $pi = 4 * ATan(1) dim $radToDeg = 180 / $pi ConsoleWrite("Angle in degrees = " & ATan($Opposite/$Adjacent) * $radToDeg & @CRLF) Link to comment Share on other sites More sharing options...
maestro Posted July 28, 2010 Author Share Posted July 28, 2010 That looks promising, however I'm newer to autoit and unfamiliar as to what consolewrite does, and how to use the out put of that, like what would I use to represent the answer. Is it a variable, or something else. Thanks. Hello, World!... LAME lol Link to comment Share on other sites More sharing options...
BuckMaster Posted July 28, 2010 Share Posted July 28, 2010 (edited) If you editing your script in Scite then consolewrite puts the output in the bottom console, but if you arn't using Scite then change this to the bottom instead of console write MsgBox( 0, "Angle", "Angle in degrees = " & ATan($Opposite/$Adjacent) * $radToDeg ) Edited July 28, 2010 by BuckMaster Link to comment Share on other sites More sharing options...
maestro Posted July 28, 2010 Author Share Posted July 28, 2010 (edited) Thanks, that works, but how do I use this as a variable. $Opposite = 10 $Adjacent = 10 dim $pi = 4 * ATan(1) dim $radToDeg = 180 / $pi MsgBox( 0, "Angle", "Angle in degrees = " & ATan($Opposite/$Adjacent) * $radToDeg ) ;<---this works fine, $ang = & ATan($Opposite/$Adjacent) * $radToDeg ;but how do I use this as a variable. (I just need the output number value not the "Angle in degrees = " part MsgBox(0,"",$ang) ;<-----------------------------------------------------------------So right here (in this example) it would give me a Msgbox that says 45 Thanks. Edited July 28, 2010 by maestro Hello, World!... LAME lol Link to comment Share on other sites More sharing options...
maestro Posted July 28, 2010 Author Share Posted July 28, 2010 (edited) Never mind, i figured it out. I just had to get rid of the & sign. Thanks SOOOOO MUCH, And thanks every one for your contributions, and putting up with me Edited July 28, 2010 by maestro Hello, World!... LAME lol Link to comment Share on other sites More sharing options...
BuckMaster Posted July 28, 2010 Share Posted July 28, 2010 You have an & in front of when you declare what $ang is, it should be, $ang = ATan($Opposite/$Adjacent) * $radToDeg 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