The PostScript programming language is designed to describe the layout of graphics and text on the printed page. This website provides online utilities that show examples in actual practice.
postscript_math-cos
Example : Math cos
%! newpath 100 600 translate 0 0 moveto /span 1 def /x 0 def /y { x cos 100 mul} def x y moveto 360 {/x x span add def x y lineto } repeat stroke showpage