NB. Methopotamian fraction mf0=: 4 : '1r2 * y + x % y' mf=: 3 : 0 NB. Usage: 1 10 mf 5 NB. Usage: mf 5 NB. y is sqre(5) NB. x is primary-value/ repeat-times TMP=.y mf0 ^:(i.10) 1 |:({@>i. 10) ,({@>TMP),: {@>1 x: TMP : if.1= # x do. x=. x,.10 end. 'S N'=: x TMP=. y mf0 ^:(i.N) S |:({@>i. N) ,({@>TMP),: {@>1 x: TMP ) NB. Newton method new_1=: 1 : ' ] - x % x D.1' (^:_)("0) new_2=: 1 : ' ] - x (%.|:)x D.1' (^:17) ("1) NB. -Julia-------------------- f5=: +&_0.2j0.8@*: NB. square -> add _0.2j0.8 f6=: +&_0.2j0.6@*: NB. square -> add _0.2j0.8 f7=: +&_0.2j0.8@(^&3) NB. (fine!) triple -> add _0.2j0.8 f8=: +&_0.4j0.6@*: NB. fine square -> add _0.2j0.8 NB. direct formula NB. viewmat ((+&_0.678j0.312@*:) julia0 4 100) fjx _1.5 512 fj0=: 3 : '+&y@*:' fjx=: 3 : '|.|: j./ ~ ({. y)+3*(i.%<:) {: y' NB. jullia fx(make canvas) esc0=: 1 : 0 NB. for test NB. f4 esc 0.3 1 // OK (,u@{:)^:(<&3@# *. <&10@:(+/)@:|@:{:)^:_ ,: y ) escapet=: 2 : 0 NB. (f4 esc 10 3) 0.3 1 // OK NB. Usage: #@(f4 esc 10 3 ) 0.3 1 NB. exchange complex number to color code 'a0 b0'=: n TMP=.(,u@{: )^:(<&b0@# *. <&a0@:(+/)@:|@:{: )^:_ ,: y # TMP ) julia0=: 2 : '>(u escapet n) L:0 {@> y' julia=: 2 : '>(u escapet 4 256) L:0 {@> fjx _1.5 512' NB. Usage: viewmat (+&_0.678j0.312@*:) julia '' NB. Usage: (f5 julia0 4 100) fjx _1.5 512 NB. fjx n1 n2 is position NB. ---mandelbrot--------------------- mandelt0=: 3 : 'y &+@*: escapet(10 255) 0' mandelt=: 3 : '> mandelt0 L:0 {@> y' NB. mandelbrot fx fmx=: 3 : ' ({. y) + 3*|.|: j./~ (i.%<:) {: y' NB. viewmat mandelt fmx _2j_1.5 256 NB. fx (x=)_2j_1.5 (n=)5/15/256 NB. 3* is scale 3 is just!! NB. (mjn) position parameter NB. m is left<-->right n is up/down