Astrolabe/API ComputeDistance

From Esamynn's Wiki

Jump to: navigation, search

Astrolabe ยป Astrolabe/API ComputeDistance

Takes two sets of coordinates and computes the distance between them in game yards.

dist, xDelta, yDelta = Astrolabe:ComputeDistance( c1, z1, x1, y1, c2, z2, x2, y2 )

Arguments

c1, z1, x1, y1
World Map Point - point 1
c2, z2, x2, y2
World Map Point - point 2

Returns

dist
Number - the absolute distance between the two points in game yards
xDelta
Number - the East/West distance from point 1 to point 2 in game yards
yDelta
Number - the North/South distance from point 1 to point 2 in game yards

Details

Specifically, the calculation is (point 2) - (point 1), so adding the xDelta and yDelta information to the first point would get you to the second point. Note that all distances follow the World Map API convention of using TOPLEFT as the 0,0 point.

This function returns nil for all arguments if trying to compute a distance between the two specified points is meaningless. (IE. one point is on Azeroth and the other is in Outland)

Personal tools