07-03-2005, 10:30 AM
For those who don't know what the distance formula is (and for those who are too lazy to look it up):
SQR((x2 - x1) ^ 2 + (y2 - y1) ^ 2)
where the coordinates (x2, y2) and (x1, y1) refer to the current node/square and the possible next node/square. The order doesn't matter since the result of the calculation is squared, which also means you don't have to add in the absolute value.
Unless Dr. D is referring to a distance formula other than the standard mathematical distance formula. . .
Edit: sorry for the double post. . .
SQR((x2 - x1) ^ 2 + (y2 - y1) ^ 2)
where the coordinates (x2, y2) and (x1, y1) refer to the current node/square and the possible next node/square. The order doesn't matter since the result of the calculation is squared, which also means you don't have to add in the absolute value.
Unless Dr. D is referring to a distance formula other than the standard mathematical distance formula. . .
Edit: sorry for the double post. . .
974277320612072617420666C61696C21 (Hexadecimal for those who don't know)