11.03.2012, 19:44
Yeah, that works but you can make it simpler:
pawn Код:
//meter
distance = floatsqroot((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2) + (z1 - z2) * (z1 - z2)) / 3.2808;
//kilometer
distance = floatsqroot((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2) + (z1 - z2) * (z1 - z2)) / 3.2808 / 1000.0;