• 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: sine wave
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: sine wave


  • Subject: Re: sine wave
  • From: Graham Cox <email@hidden>
  • Date: Mon, 1 Feb 2010 14:05:11 +1100

On 01/02/2010, at 1:59 PM, Glenn L. Austin wrote:

> On Jan 31, 2010, at 6:46 PM, Graham Cox wrote:
>
>>
>> On 01/02/2010, at 1:22 PM, Chunk 1978 wrote:
>>
>>> i'm searching for a general algorithm to produce a cartesian sine wave
>>> that outputs numbers, which i suppose would be based on maximum
>>> distance (range) from Y while using a timer.
>>
>> v = range * sin(t)
>>
>> --Graham
>
> Just remember that the argument to sin() must be in radians.  To convert degrees to radians, radians = degrees * kPI / 180.0;


Real programmers (TM) don't use degrees ;-) Except for UI input/display.

For that, these macros are useful:

#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

References: 
 >sine wave (From: Chunk 1978 <email@hidden>)
 >Re: sine wave (From: Graham Cox <email@hidden>)
 >Re: sine wave (From: "Glenn L. Austin" <email@hidden>)

  • Prev by Date: Re: Highlighting search results in table
  • Next by Date: [Moderator] Re: sine wave
  • Previous by thread: Re: sine wave
  • Next by thread: [Moderator] Re: sine wave
  • Index(es):
    • Date
    • Thread