# [Maxima] plot 2D pseudo-bug

Dan Hatton vi5u0-maxima at yahoo.co.uk
Sat Oct 3 12:59:53 CDT 2009

```On Sat, 3 Oct 2009, Adam Majewski wrote:

> I have found intresting article (in Polish):
> http://www.mimuw.edu.pl/delta/artykuly/delta1009/0910-07-czy_komputer.pdf
> Authot says that because of rasterisation of curve, it is possible to
> find such float number n that graf of sin(n*x)
> looks like graf of sin(x).
> for Octave n= 71.372
> for Maxima n = 403.124
> In my Maxima it does not work ( I see graf that is different than sin(x) ).
> What do you think about it ?

This is an example of an effect called aliasing
<http://en.wikipedia.org/wiki/Aliasing>.  The value of n where it
takes the particular form the author describes will depend on the
width of the domain of x over which you plot and the number of samples
the plotting programme takes in x space: something along the lines of

n = (%pi*(number of samples)/(domain width))+1.

On the other hand, your trig function will plot correctly if

n < (%pi*(number of samples)/(domain width))

This condition for n is variously called the "Nyquist criterion" or
the "Shannon sampling theorem".  If you really need to plot a trig
function of high frequency (large n) over a broad domain, then you'll
have to increase the number of samples appropriately.

--

HTH,

Dan
```