Exercises

To do well at PS programming, start by getting a very simplified picture up. Then add on features.

The most important thing is not to feel embarassed if you are slow. Have patience. It's like learning how to talk. You'll probably need to draw many sketches by hand.

1. Fourier series

  • Set up a figure 400 x 400 points. Clip to its bounding box. Centre the coordinate system, and choose a scale of 1 cm. Draw the axes. Then draw a square-wave.
  • Graph the first approximation to the square wave 2 sin(2 pi x)/pi.
  • Draw the approximation by 9 terms. The n-th term is 2 sin (2 pi n x)/pi n.
  • Now make a series of pages, amounting to a simple animation.

2. Hexagons

  • Start as before. Draw a single hexagon of outer radius 1.
  • Draw a tiling of the plane by the fundamental domain of g2. Label the edges by colouring them.