Sign in to follow this  
Followers 0
maestro

Angle finding help please

15 posts in this topic

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

Share this post


Link to post
Share on other sites



Doesn't any one know... ><

PLEASE!


Hello, World!... LAME lol

Share this post


Link to post
Share on other sites

#3 ·  Posted (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 by water

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Have a look at this UDF.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

#6 ·  Posted (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 by maestro

Hello, World!... LAME lol

Share this post


Link to post
Share on other sites

#7 ·  Posted (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 by Jos

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

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

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______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

 

Share this post


Link to post
Share on other sites

#9 ·  Posted (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 by maestro

Hello, World!... LAME lol

Share this post


Link to post
Share on other sites

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)

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

#12 ·  Posted (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 by BuckMaster

Share this post


Link to post
Share on other sites

#13 ·  Posted (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 by maestro

Hello, World!... LAME lol

Share this post


Link to post
Share on other sites

#14 ·  Posted (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 :blink:

Edited by maestro

Hello, World!... LAME lol

Share this post


Link to post
Share on other sites

You have an & in front of when you declare what $ang is,

it should be,

$ang = ATan($Opposite/$Adjacent) * $radToDeg

Share this post


Link to post
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
Sign in to follow this  
Followers 0