Re: Dead Reckoning
Re: Dead Reckoning
- Subject: Re: Dead Reckoning
- From: Graham Cox <email@hidden>
- Date: Sat, 10 Oct 2015 15:13:33 +1100
> On 10 Oct 2015, at 1:58 am, Michael de Haan <email@hidden> wrote:
>
> func degrees2radians(coordinate:CLLocationDegrees) -> Double {
>
> return (M_PI * coordinate ) / 180.00
> }
>
> func radians2degrees(coordinate:CLLocationDegrees) -> Double {
>
> return (180.00 * coordinate ) / M_PI
> }
>
JFYI:
It might be worth noting that for performance crtical code, these two functions can be replaced by simple multiply-by-a-constant macros:
#define DEGREES_TO_RADIANS( d ) ((d) * 0.0174532925199432958)
#define RADIANS_TO_DEGREES( r ) ((r) * 57.29577951308232)
—Graham
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden