세 개의 지오 로케이션 사이의 각도를 계산해야합니다.이 중 두 개는 항상 같고 한 개만 변경됩니다 (예 : 사용자가 걷는 경우).세 개의 지오메트리 사이의 각도
먼저 포인트 사용자의 시작 위치이다. 두 번째 점은 사용자의 현재 위치이므로 첫 번째 점은 두 번째 점과 같습니다. 첫 번째 점과 고정 점은 항상 같습니다. 각 지점마다 위도와 경도가 있습니다.
는 I이 화학식 사용하려고 :double angle1 = Math.atan2(startingLocation.getLongitude() - destinationLocation.getLongitude(), startingLocation.getLatitude() - destinationLocation.getLatitude());
double angle2 = Math.atan2(currentLocation.getLongitude() - destinationLocation.getLongitude(), currentLocation.getLatitude() - destinationLocation.getLatitude());
return Math.toDegrees(angle1 - angle2);
을하지만, 예를 들어도 제외한 제 점 == 번째 포인트 I 0이어야하지만 날 (176)도 같은 이상한 결과를 제공 할 때. 문제가 어디에 있습니까?
@ Sabish.M이 주제의 그림 만 빌 렸습니다. – TomTom