CLLocationManager 및 locationManager를 사용하여 loc 기반 앱을 구축하고 있습니다. didUpdateToLocation : fromLocation : 사용자가 다른 처리를 실행하기에 충분히 이동했는지 확인하려고합니다. 이중 변수를 사용하고 있습니다. 저는 오래 전 복식을 동일시하지 않고 델타를 임계 값과 비교하는 것을 배웠습니다. 델타는 0이다 : 두 개의 다른 두 배를 뺀 결과가 0이됩니다.
double latDelta = abs(theConsumer.latLong.clLocation.coordinate.latitude - newLocation.coordinate.latitude);
double lonDelta = abs(theConsumer.latLong.clLocation.coordinate.longitude - newLocation.coordinate.longitude);
NSString *fooBar = [NSString stringWithFormat:
@"???Delta LAT: abs(current (%f) - new (%f)) = delta %f.",
theConsumer.latLong.clLocation.coordinate.latitude,
newLocation.coordinate.latitude,
latDelta];
이 출력을 얻을 수 ... 0.0005f
의 델타 그러나이 코드에 - 나는 (새) 이전 복근을 비교합니다.
GPSLogger.m : (26)> GPSLOG : GPS : 39.4425- 북한, 77.8132- 웨스트/n를 MeterAccuracyFormat 0
GPSLogger.m : (26)> GPSLOG : 새로운 좌표 발견 : 위도 : 39.442494 경도 : -77.813175 DataModel.m : (197)> DistanceFromLoc : 710.517020 DataModel.m : (199)> 델타> 0.000500 DataModel.m : (214)> 델타 LAT : abs (현재 (39.440120) - 신규 (39.442494))) = 델타 0.000000.
숫자가 넘치십니까? 이 작업을 수행 할 수있는 더 좋은 방법이 있습니까 (즉, 작동하는 방법)?
감사합니다.
은 아주 많이 따랐습니다. – Rayfleck