> On Oct 9, 2015, at 21:13 , Graham Cox <[email protected]> wrote:
> 
> 
>> On 10 Oct 2015, at 1:58 am, Michael de Haan  <[email protected]> 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 protected]



_______________________________________________

Cocoa-dev mailing list ([email protected])

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to