piclist 1998\11\05\105906a >
Thread: sin function
picon face BY : Peter L. Peres email (remove spam text)

On Wed, 4 Nov 1998, Scott Dattalo wrote:

{Quote hidden}

No, it's an incremental algorythm that computes the y for a given x in a
Cartesian space such that when x varies from 0 to N y is the corresp.
sinus. If you plot x,y as you calculate them you obtain 1/8 circle.

There is also one for ellipses, straights and some more stuff. Look it up,
you will like it VERY much, I am sure ;)

> equiangular) steps. If that's the case, then it's not too unsimilar to the
> goertzel algorithm. The problem I've found with the goertzel algorithm is

I don't know the Goertzel. I'll look it up.

> that round off errors gradually increase to the point where sines and
> cosines are no longer produced. If you're computing a few cycles of sines
> and cosines, then the goertzel algorithm is great: it's fast and
> efficient.

Nono. The Bresenham computes nicely. The only problem is the joinery for
1/8 circles which includes a parity problem and must be solved separately
(for 1 point per circle).

> And I suspect because of round off errors you'd have to repeat this
> quarter circle calculation every quarter of a circle - unless of course
> you store the results in an array. But if you do that, you might as well
> implement the array...

It's incremental, mister. You compute it for 1/8 circle = 1/8 sine = 45
degrees. The trick is, that it does not yield a sine directly, but the
sine is included in the result (already scaled and integer). I'll try to
elaborate on this. imho this algorythm can divide the required table space
for a 1/4 sine by 4. On a PIC this should be significant. Later.



In reply to: <Pine.GSO.3.95q.981104094737.8049A-100000@unix.sri.com>
See also: www.piclist.com/techref/method/math.htm?key=sin
Reply You must be a member of the piclist mailing list (not only a www.piclist.com member) to post to the piclist. This form requires JavaScript and a browser/email client that can handle form mailto: posts.
Subject (change) sin function

month overview.

new search...