AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Calculate Distance (https://forums.alliedmods.net/showthread.php?t=240048)

ezio_auditore 05-08-2014 03:07

Calculate Distance
 
Hello.
I don't know how to calculate distances b/w two coordinates.
I have these:
Code:
Float:f_Origin[3] // our origin Float:v_Origin[3] // other origin
So, what will the distance b/w f_Origin and v_Origin

Backstabnoob 05-08-2014 03:28

Re: Calculate Distance
 
Why not search? vector_distance(origin1, origin2 )

Black Rose 05-08-2014 03:44

Re: Calculate Distance
 
Pythagoras theorem

WildCard65 05-08-2014 11:46

Re: Calculate Distance
 
Quote:

Originally Posted by Black Rose (Post 2135111)
Pythagoras theorem

I think it's called the Pythagorean Theorem.

Black Rose 05-08-2014 14:20

Re: Calculate Distance
 
Sorry. Some Swedish slipped in there.

Backstabnoob 05-08-2014 16:35

Re: Calculate Distance
 
Both are correct actually.

.Dare Devil. 05-08-2014 16:41

Re: Calculate Distance
 
PHP Code:

Float:get_distance_f(float:v[3],Float:v2[3]) 

this is what i use. ( I love fakemeta )

ezio_auditore 05-09-2014 04:20

Re: Calculate Distance
 
Quote:

Originally Posted by .Dare Devil. (Post 2135376)
PHP Code:

Float:get_distance_f(float:v[3],Float:v2[3]) 

this is what i use. ( I love fakemeta )

Winner!....


All times are GMT -4. The time now is 09:46.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.