%!PS
%
% @file      lorenz1.ps
% @author    Mitch Richling <https://www.mitchr.me>
% @Copyright Copyright 1996 by Mitch Richling.  All rights reserved.
% @brief     Draw the Lorenz strange attractor.@EOL

0.12 10 div setlinewidth 
0 setlinewidth

300 400 translate
10.0 10.0 scale

0 100 moveto
0 -100 lineto
stroke

100 0 moveto
-100 0 lineto
stroke

0.1 0.0 0.0
3 copy pop exch moveto
9000 {
  3 copy pop exch sub 10.0 mul 0.01 mul 3 index add 4 1 roll
  3 copy 2 index mul add exch 28.0 mul exch sub 0.01 mul 2 index add 4 1 roll
  3 copy 8.0 3.0 div mul 3 1 roll mul exch sub 0.01 mul add exch pop exch pop
  3 copy pop exch lineto 
} repeat
stroke
showpage