Difference between revisions of "0509"

From GTAMods Wiki
Jump to navigation Jump to search
(page updates)
 
Line 4: Line 4:
 
| description = Gets the distance between two X and Y coordinate points
 
| description = Gets the distance between two X and Y coordinate points
 
| syntax1    = 0509: [''var''] = distance_between_point [''flt1''] [''flt2''] and_point [''flt3''] [''flt4'']
 
| syntax1    = 0509: [''var''] = distance_between_point [''flt1''] [''flt2''] and_point [''flt3''] [''flt4'']
| p1t        = [''var'']
+
| p1t        = [''flt1'']
| p1d        = Variable to store the distance, a floating-point value
+
| p1d        = X1-coordinate
| p2t        = [''flt1'']
+
| p2t        = [''flt2'']
| p2d        = X1-coordinate
+
| p2d        = Y1-coordinate
| p3t        = [''flt2'']
+
| p3t        = [''flt3'']
| p3d        = Y1-coordinate
+
| p3d        = X2-coordinate
| p4t        = [''flt3'']
+
| p4t        = [''flt4'']
| p4d        = X2-coordinate
+
| p4d        = Y2-coordinate
| p5t        = [''flt4'']
+
| p5t        = [''var'']
| p5d        = Y2-coordinate
+
| p5d        = Variable to store the distance, a floating-point value
 
| native      = [[GET_DISTANCE_BETWEEN_COORDS_2D]]
 
| native      = [[GET_DISTANCE_BETWEEN_COORDS_2D]]
 
}}
 
}}

Latest revision as of 00:46, 20 November 2016

Vice City San Andreas GET_DISTANCE_BETWEEN_COORDS_2D


Description
Gets the distance between two X and Y coordinate points
Syntax
0509: [var] = distance_between_point [flt1] [flt2] and_point [flt3] [flt4]
Parameter
[flt1]
X1-coordinate
[flt2]
Y1-coordinate
[flt3]
X2-coordinate
[flt4]
Y2-coordinate
[var]
Variable to store the distance, a floating-point value
Native analog
GET_DISTANCE_BETWEEN_COORDS_2D

This opcode gets the distance between two X and Y coordinate points. It uses the distance formula in rectangular coordinate system to calculate the distance between the points.

Keywords

get, store, distance, between, coords, coordinates, 2d

See also

  • Vice City San Andreas 050A, gets the distance between two X, Y, and Z coordinate points