Sign in to follow this  
Followers 0
FuryCell

_Distance()

25 posts in this topic

Just a quick scrap that calculates the distance between two points. It can be used to calculate the distance between two elements on the screen. Using it is pretty self explanatory.

Func _Distance($iX1, $iY1, $iX2, $iY2)
    Return Sqrt(($iX1 - $iX2) ^ 2 + ($iY1 - $iY2) ^ 2)
EndFunc  ;==>_Distance

HKTunes:Softpedia | GoogleCodeLyricToy:Softpedia | GoogleCodeRCTunes:Softpedia | GoogleCodeMichtaToolsProgrammer n. - An ingenious device that turns caffeine into code.

Share this post


Link to post
Share on other sites



Nice!!

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

Hah, my math teacher(I'm only 15) told me about that this week. And now there is an au3 for it! :whistle:

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

This is the easest idea ever i learned it in grade 3. :whistle:;):P;):D:idea:

you learned about roots and powers in 3rd grade??

@SolidSnake..

Cool, now you should do one for 3D. lol

Func _Distance3($Vertex1, $Vertex2)
;Do your stuff here
$x1 = $Vertex1[0]
$y1 = $Vertex1[1]
$z1 = $Vertex1[2]

$x2 = $Vertex2[0]
$y2 = $Vertex2[1]
$z2 = $Vertex2[2]
EndFunc
Edited by CHRIS95219

Share this post


Link to post
Share on other sites

you learned about square roots and powers in 3rd grade??

What are those? :whistle:


What goes around comes around... Payback's a bitch.

Share this post


Link to post
Share on other sites

Its the same in 3d as in 2d..... just one more sqare under the root


Share this post


Link to post
Share on other sites

Its the same in 3d as in 2d..... just one more sqare under the root

Don't get me started on distance calculation, Z-mapping or anything else 3D related. :whistle:

Share this post


Link to post
Share on other sites

im only in grade 6.

Oh, So thats why you act so childish?

Share this post


Link to post
Share on other sites

#14 ·  Posted (edited)

Whats Up with 3D victors anyways???

I dont even use them... :whistle:;):P

But the script would be helpful. ;):D:idea:

lmao.. who's victor? Edited by CHRIS95219

Share this post


Link to post
Share on other sites

The word is vector. A vector is also a corner in a geometric shape.

Vectors consist of the standard X and Y, but also a Z coordinate as well. I wonder what good 3D calculations are in AutoIt though.

Trying to calculate the distance between two 3D points is a little more complicated.

Share this post


Link to post
Share on other sites

#17 ·  Posted (edited)

A Victor is a point in a rendered 3D world. :whistle:;):P

It's called a vector , not victor. ;):D:idea:

Edit: too slow

Edited by SolidSnake

HKTunes:Softpedia | GoogleCodeLyricToy:Softpedia | GoogleCodeRCTunes:Softpedia | GoogleCodeMichtaToolsProgrammer n. - An ingenious device that turns caffeine into code.

Share this post


Link to post
Share on other sites

The word is vector. A vector is also a corner in a geometric shape.

Vectors consist of the standard X and Y, but also a Z coordinate as well. I wonder what good 3D calculations are in AutoIt though.

Trying to calculate the distance between two 3D points is a little more complicated.

Check out my 3D library. Link. I'm willing to create a _Distance3D function if anyone has a need for it.

Share this post


Link to post
Share on other sites

Check out my 3D library. Link. I'm willing to create a _Distance3D function if anyone has a need for it.

as Wus already said, just add the 3rd dimension to the function and your done....


__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

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