Re: Dead Reckoning
Re: Dead Reckoning
- Subject: Re: Dead Reckoning
- From: Rick Mann <email@hidden>
- Date: Fri, 09 Oct 2015 21:21:34 -0700
> On Oct 9, 2015, at 21:13 , Graham Cox <email@hidden> wrote:
>
>
>> 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)
The compiler should figure that out either way it's written.
--
Rick Mann
email@hidden
_______________________________________________
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