public double distanceTo(Stop stop) { double x = (stop.longitude - longitude) * Math.cos((latitude + stop.latitude) * Math.PI / 360); double y = stop.latitude - latitude; return Math.sqrt(x * x + y * y) * 6371; }