Jump to content

Angle finding help please


Recommended Posts

Hi, I'm currently writing a program that requires based on opposite and adjacent numbers.

-opposite = 10

-adjacent = 10

Now 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

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 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 - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

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 - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

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

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 by maestro

Hello, World!... LAME lol

Link to comment
Share on other sites

  • Developers

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 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

  • Moderators

maestro,

Firstly, which part of water's comment:

Wait at least 24 hours before bumping a thread! This is no 24 hours support forum

did you not understand? :blink:

Secondly, how insulting did you mean to be with:

because its now daytime

Where 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 AutoIT

This 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. :P

M23

Edit: Aha, pissed off more than just me! "Way to go" as you would probably say!

Edited by Melba23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

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 by maestro

Hello, World!... LAME lol

Link to comment
Share on other sites

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

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 by BuckMaster
Link to comment
Share on other sites

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 by maestro

Hello, World!... LAME lol

Link to comment
Share on other sites

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 :blink:

Edited by maestro

Hello, World!... LAME lol

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...