Author: Thomas Brandstätter (e0927911@student.tuwien.ac.at)
Source: downlaod
binary_operator
% complex operators
dup (++) eq { tok_cadd }{
dup (--) eq { tok_csub }{
dup (**) eq { tok_cmul }{
dup (//) eq { tok_cdiv }{
% basic operators
dup (+) eq { tok_add }{
dup (-) eq { tok_sub }{
dup (*) eq { tok_mul }{
dup (/) eq { tok_div }{
unary_postfix_operator
% complex operators
dup (^^2) eq { tok_csqr }{
dup (^^3) eq { tok_ccub }{
unary_operator
% complex operators
dup (||) eq { tok_cabs }{
dup (|/) eq { tok_cria }{
... get translated into this postscript functions ...
/tok_cadd [5100 (complex_add)] def
/tok_csub [5101 (complex_sub)] def
/tok_cmul [5310 (complex_mul)] def
/tok_cdiv [5311 (complex_div)] def
/tok_csqr [7000 (complex_sqr)] def
/tok_ccub [7000 (complex_cub)] def
/tok_cabs [6000 (complex_abs)] def
/tok_cria [6000 (complex_ri_abs)] def
/tok_add [4110 (add)] def
/tok_sub [4111 (sub)] def
/tok_mul [4310 (mul)] def
/tok_div [4311 (div)] def
(z ^^2 ++ c) tokenize
[10 (z)] [7000 (complex_sqr)] [5100 (complex_add)] [10 (c)]
[10 (z)] [7000 (complex_sqr)] [5100 (complex_add)] [10 (c)] parse
[10 (z)] [7000 (complex_sqr)] [10 (c)] [5100 (complex_add)]
[10 (z)] [7000 (complex_sqr)] [10 (c)] [5100 (complex_add)] codegen
(zr zi complex_sqr cr ci complex_sub)
( 1) /wh_point_step { 2 } def %% x y step
point_step
( 2) /wh_scale { 1 div floor cvi } def %% scale whole image
( 3) /width { 725 wh_scale } def %% fractal width
( 4) /height { 450 wh_scale } def %% fractal height
( 5) /center_y -0.28 def %% x center of view in complex area
( 6) /center_x 0.72 def %% y center of view in complex area
( 7) /zoom 32 def %% zoom level of view
( 8) /color_map (default) def %% definitions from
colors directory
( 9) /iterate_maximum 100 def %% recusion escape value
(10) /limit_value 4 def %% limit of z
(11) (z ^^2 ||) tokenize parse codegen
/limit_formula exch def
(12) (z ^^2 -- c) tokenize parse codegen
/iterate_formula exch def
/wh_point_step 1 def |
/wh_point_step 2 def |
/wh_point_step 5 def |
very slow | slow | fast |
lyapunov2 | continues3 | green |
center
(0, 0) |
(0, 1) |
(0, 1.5) |
zoom
zoom 4 | zoom 8 | zoom 16 |
Important goals: mb cbs color_test test
make mb
make cbs
make color_test
make test