• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Dead Reckoning
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Dead Reckoning
      • From: Rick Mann <email@hidden>
References: 
 >Dead Reckoning (From: Michael de Haan  <email@hidden>)
 >Re: Dead Reckoning (From: Michael de Haan  <email@hidden>)

  • Prev by Date: Re: NSButton with NSTexturedRoundedBezelStyle outside of NSToolbar
  • Next by Date: Re: Dead Reckoning
  • Previous by thread: Re: Dead Reckoning
  • Next by thread: Re: Dead Reckoning
  • Index(es):
    • Date
    • Thread