Aliasing? (was Re: Spiral)

Peter Hansen peter at engcorp.com
Thu May 30 19:43:57 EDT 2002


Chris wrote:
> 
> I've written a small QBASIC program which draws a spiral. Here is the
> code:
> 
> SCREEN 12
> CLS
> FOR t = 1 TO 400 STEP .01
> x = .5 * t * COS(t)
> y = .5 * t * SIN(t)
> PSET (x + 320, y + 240)
> NEXT t
> 
> I noticed that it generated some interesting patterns, probably as a
> result of rounding errors.  These can be explored further by making the
> spiral tighter.

This sounds a lot like a moire pattern, which is an aspect of the
phenomenon called "aliasing".  I found a reasonable explanation of this 
and some examples in this PDF: 

http://www-2.cs.cmu.edu/afs/andrew/scs/cs/15-463/pub/www/notes/aliasing.pdf

With pixelized graphical output devices, aliasing manifests itself
as strange optical patterns formed when you have closely spaced adjacent
lines which are not vertical or horizontal, and the effect becomes
even more pronounced with certain kinds of curves, perhaps such as 
your spirals.

-Peter



More information about the Python-list mailing list