[A89] Graphing
[Prev][Next][Index][Thread]
[A89] Graphing
Is it possible to graph spheres on the ti-89?
If so, what is the formula?
>From: jeff <jefromi42@yahoo.com>
>Reply-To: assembly-89@lists.ticalc.org
>To: assembly-89@lists.ticalc.org
>Subject: [A89] Re: filling ellipses
>Date: Mon, 9 Jul 2001 16:30:30 -0700 (PDT)
>
>
>It DOES work correctly, and does not test every pixel; it draws lines
>across when it gets done. I
>agree though, it is slow.
>jeff
>
> > Now, as for why the "formula" algorithm is a very, very poor (and very
> > slow!) solution:
> >
> > 1.) It tests each pixel individually. Other algorithms have no need to
>do
> > this, and compared to them you're looping through an absurd number of
>times.
> > I see that you're taking advantage of the symmetry to only test 1/4 of
>the
> > pixels, but that's still excruciatingly slow.
> >
> > 2.) It relies heavily on multiplication and division. Much of computer
> > science revolves around circumventing those operations, since they are
>two
> > of the slowest operations a computer needs to perform. The beauty of
>the
> > Bresenham ellipse algorithm is that really only requires two
> > multiplications, total (the multiplications by powers of two will be
> > converted into bit shifts, and are therefore not multiplication after
> > compilation) and _no_ division. I would assume that TI uses this
>algorithm
> > internally.
> >
> > 3.) It uses floating point operations. Once again, the other algorithms
>do
> > not need this.
> >
> > While the code you have written will work with a modification or two, it
>is
> > entirely the wrong approach and should be simply scratched.
> >
> >
> > Now, IF you were to get the Bresenham ellipse algorithm that Olle
>pointed
> > out to work -- you'd have to find another implementation, since the one
>Olle
> > pointed out seems to have not worked when you tested it -- and IF you
> > changed it to use lines, as was suggested, it STILL would not work with
>XOR!
> > That's because, as long as you could have two horizontally or vertically
> > adjacent pixels, then you're bound to have overlapping lines. Once
>again,
> > XOR does not like overlap.
> >
> > You are then left with one solution -- draw the a solid ellipse in a
>buffer,
> > then XOR it onto the screen, just as I suggested in the first place.
>And as
> > long as you're doing that, you can the fast, working TIOS ellipse
>drawing
> > routine.
> >
> > So, in the end, you're left with only one way to draw a reasonably fast,
> > filled ellipse using XOR -- exactly what I suggested yesterday. I
>suggest
> > you overcome your virtual screen stigma, since it's certainly more than
>easy
> > enough to use them.
> >
> > As for XORing a VS onto the actual screen, that should be relatively
>simple:
> >
> > void xorScreens(void *VS) // I think this should work
> > {
> > unsigned long *VSptr = (unsigned long *)VS;
> > unsigned long *screenptr = (unsigned long *)LCD_MEM;
> > int i;
> >
> > for (i=0; i < (240/8*128)/sizeof(unsigned long); ++i)
> > *(VSptr++) ^= *(screenptr++);
> > }
> >
> > -Scott
> >
> >
> >
>
>
>__________________________________________________
>Do You Yahoo!?
>Get personalized email addresses from Yahoo! Mail
>http://personal.mail.yahoo.com/
>
>
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com
Follow-Ups: