下面的方法一直返回0,我不知道为什么!请帮忙!
currentLocation.setLatitude(38.03211);
currentLocation.setLongitude(-78.51002);
如果 loc 的经度/纬度是 38.03161, -78.51075,
public double getDistance(HistoricalLocation loc) {
return (double) Math.abs(Math.sqrt((currentLocation.getLatitude() - loc
.getLatitude())
* (currentLocation.getLatitude() - loc.getLatitude())
+ (currentLocation.getLongitude() - loc.getLongitude())
* (currentLocation.getLongitude() - loc.getLongitude())));
}