Search code examples
iphoneobjective-ciosmathradians

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


what is the equivalent of java function

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

in objective-c?


Solution

  • #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