Google-Code-Fork / tibiaapi

Automatically exported from code.google.com/p/tibiaapi
MIT License
0 stars 0 forks source link

Location.DistanceTo returns incorrect results #142

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Calling Location.DistanceTo

What is the expected output? What do you see instead?
The expected result of the mathematical formula used to obtain the location
between two points in space (perhaps disregarding floor level?).
Instead it's returning the difference of the abscissa (or ordinate) of the
two locations, whichever is smaller...

Please provide any additional information below.
The result of this function should be calculated as follows:
D = sqrt((X1^2 - X0^2) + (Y1^2 - Y0^2))     <-- ignoring Z
D = sqrt((X1^2 - X0^2) + (Y1^2 - Y0^2) + (Z1^2 - Z0^2))
Where first location is defined by the point (X0, Y0, Z0) and the second
location by (X1, Y1, Z1), and D is the distance.

Original issue reported on code.google.com by ing.cabr...@gmail.com on 30 Apr 2009 at 2:24

GoogleCodeExporter commented 9 years ago
Fixed in r658.

Original comment by ian320 on 6 May 2009 at 4:13