Re: sine wave
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