R/MandelIterate.R

Defines functions MandelIterate

Documented in MandelIterate

MandelIterate <-
function(z_0) {
#
# Return number of iterations before
# the value escapes to infinity
#   
#
   i <- 1 
   z <- 0
   ins <- 1 
   while(i < 51) {
     i <- i+1
     z <- z*z + z_0
     if(abs(z) > 2 ) { ins <- i; break; }
    } 
 return(ins);
}

Try the Julia package in your browser

Any scripts or data that you put into this service are public.

Julia documentation built on Aug. 27, 2023, 5:07 p.m.