Telegraphics home

Sine waves in PostScript


The following images illustrate how the step size can be varied to generate different Bézier approximations. The step size parameter should not be more than pi/2 radians (or you get results like this).

Step = pi/2 radian
Sine wave, step = pi/2 radians

Step = pi/3 radian
Sine wave, step = pi/3 radians

Step = pi/4 radian
Sine wave, step = pi/4 radians
(This approximation should be good enough for most purposes. The PostScript source for this annotated diagram is here.)

Step = pi/6 radian
Sine wave, step = pi/6 radians

As a parting thought, it's possible to get a decent approximation with a step as large as pi radians, by shifting the phase by pi/2:
Sine wave, step = pi/6 radians
(Code for this is here.)

Back to software index (and download links)