greenmachine Posted October 21, 2005 Share Posted October 21, 2005 (edited) My friend was programming a similar program in Java last year, and since then I've always wanted to try it for myself. I never got good enough at Java to do it, so once I found AutoIt I decided to try it. I finally got around to it again, and this is the result. It starts off with two random line segments, colored red and blue to distinguish them from the black axes, and tells if the segments intersect or not. If they are parallel (which is unlikely, as all the points are randomly generated), it tells that in the label. If they do not intersect, it tells that too. And if they do intersect, it tells the intersection point in pixels (each grid line is 10 pixels from the center). The "Refresh Lines" button randomly generates two more lines, overwriting the previous two. The "Find Intersection" button gives much more information than the label: it tells all the points of the lines as well as the intersection point. If the two line segments are not intersecting, this message box will tell the intersection point if the two segments were extended into their full lines (always fun to play around with). This picture shows the main window with lines and intersection point label. Drawing3.au3 Note: this requires the beta version of AutoIt (I used 3.1.1.76), as the graphic controls are new. Edit - One more thing: I don't really know if it bothers anyone else, but it has to refresh a lot to make all the changes, and does a lot of flashing onscreen (lots of stuff to refresh). If there's any way to fix that, that'd be cool. Also, it might be processor-intensive, as I am constantly running a function to check intersections and update the label during my onevent loop. It didn't seem to bother me, as my computer is always running at 100% due to other programs going on in the background. Just a heads-up. Edited October 21, 2005 by greenmachine Link to comment Share on other sites More sharing options...
Qwerty212 Posted April 17, 2014 Share Posted April 17, 2014 Thanks a lot for you .au3. I was trying to create something similar (I want to measure the angles between the lines) and your code is going to save me a lot of work. (I know that this thread is from 2005, just wanted to say thanks if the OP reads it) Link to comment Share on other sites More sharing options...
UEZ Posted April 17, 2014 Share Posted April 17, 2014 OP is offline since 6 years. Do you think he/she will read this? Br, 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...
Werty Posted April 17, 2014 Share Posted April 17, 2014 There's a chance if the OP has email notification turned on, as adolfitos reply was the first But yea, necro'ing it is Some guy's script + some other guy's script = my script! 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