And if half-degrees are too coarse for you, you can take advantage of the 
cyclic nature of the derivatives of sine and cosine, and run the Taylor series 
out as far as you like (though you'd probably lose out to a 
professionally-crafted trig library pretty quickly). I guess that could be 
vectorized, but it's one more thing to debug. Profile the Accelerate.framework 
functions first.

        — F

On 8 Aug 2013, at 10:01 AM, Thomas Wetmore <[email protected]> wrote:

> p.s.  Of course you don't have to call sin() and cos() for
> every half degree when building these tables. You can take advantage
> of how trig functions repeat in the four quadrants, and you can
> take advantage of other inverse and pythagorean reationships
> that exist between them. Even the initial table building
> can be optimized.
> 
> Tom Wetmore
> 
> On Aug 8, 2013, at 10:53 AM, Thomas Wetmore <[email protected]> wrote:
> 
>> Returning strictly to the issue of trig performance. A solution I
>> have used in the past is to initialize tables of trig functions,
>> say by calling sin() and cos() for every half a degree, and then
>> interpolating those tables, never calling sin() or cos() again.
>> I did this 29 years ago on an Atari 520ST to simulate the solar
>> system, and it worked well. You only need enough trig accuracy
>> for graphics to plot to the correct pixels. It takes very few
>> decimal places to get that accuracy.
>> 
>> Tom Wetmore
>> _______________________________________________
>> 
>> 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/ttw4%40verizon.net
>> 
>> This email sent to [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/anderson.fritz%40gmail.com
> 
> This email sent to [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