# _Distance()

## Recommended Posts

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.

Nice!!

8)

##### Share on other sites

thanks all for the replies.

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

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

##### Share on other sites

This is the easest idea ever i learned it in grade 3.

##### Share on other sites

This is the easest idea ever i learned it in grade 3.

@SolidSnake..

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

```Func _Distance3(\$Vertex1, \$Vertex2)
\$x1 = \$Vertex1[0]
\$y1 = \$Vertex1[1]
\$z1 = \$Vertex1[2]

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

##### Share on other sites

What are those?

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

##### Share on other sites

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

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

##### Share on other sites

Whats Up with 3D victors anyways???

I dont even use them...

But the script would be helpful.

##### Share on other sites

And You could include Sine And Cosine to capculate the next cord

##### Share on other sites

Oh, So thats why you act so childish?

##### Share on other sites

Whats Up with 3D victors anyways???

I dont even use them...

But the script would be helpful.

lmao.. who's victor? Edited by CHRIS95219

##### Share on other sites

A Victor is a point in a rendered 3D world.

##### 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 on other sites

A Victor is a point in a rendered 3D world.

It's called a vector , not victor.

Edit: too slow

Edited by SolidSnake

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

MisSpelling...

##### 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 on other sites

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

__________________________________________________________(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 *

## Create an account

Register a new account

• ### Recently Browsing   0 members

×

• Wiki

• Back

• #### Beta

• Git
• FAQ
• Our Picks
×
• Create New...