objective-c : what is the equivalent of java Math.toRadians(EndLat - StartLat) in objective-c?

StackOverflow https://stackoverflow.com/questions/7791651

문제

what is the equivalent of java function

Double EndLat;
Double StartLat;
Math.toRadians(EndLat - StartLat); 

in objective-c?

도움이 되었습니까?

해결책

#include <math.h>

(EndLat - StartLat) * M_PI / 180.0;

You might want to put this in a function if you're going to be using it a lot

다른 팁

Well Math.toRadians(a) seems to compute the radians from the angle a.

According to any sufficient basic math text, the equivalent code would be

result = a * 3.14159265358979323846 / 180.0

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top