IterativeMaps
Escape
generator for escape images
Calling Sequence
Parameters
Options
Description
Examples
Compatibility
Escape( vars, exprlist, init, escapecond, xmin, xmax, ymin, ymax )
Escape( vars, exprlistlist, init, escapecond, xmin, xmax, ymin, ymax, probabilities )
Escape( vars, exprlist, init, escapecond, xmin, xmax, ymin, ymax, opts )
Escape( vars, exprlistlist, init, escapecond, xmin, xmax, ymin, ymax, probabilities, optsu )
vars
-
list of names, with length greater than or equal to 1, specifying the variables of the iterative function
exprlist
list of algebraic expressions defining the iterative function on vars. exprlist must be of the same length as vars.
exprlistlist
list of lists of algebraic expressions defining the iterative functions on vars, with probabilities defined by probabilities. Each list of expressions must be of the same length as vars.
init
list of numeric real values or expressions in the variables xvariable, yvariable, with the same length as vars, specifying the initial values of vars
escapecond
boolean expression specifying the condition when the iteration sequence breaks and the coloring procedures, defined by redexpression, greenexpression, and blueexpression, are applied
xmin
real value determining the minimum value of xvariable
xmax
real value determining the maximum value of xvariable
ymin
real value determining the minimum value of yvariable
ymax
real value determining the maximum value of yvariable
probabilities
(optional) list of positive real numbers, such that probabilitiesi∑i=1N⁡probabilitiesi, where N is the length of probabilities, defines the probability that the ith expression list in exprlistlist will be used for Fj on the jth iteration, as explained below. The length of probabilities must be of the same length as the number of lists in exprlistlist. The default value is [1]
iterations : keyword option of the form iterations=val, where val is a posint specifying the number of times the function defined by exprs will be applied at each (xvariable,yvariable) value. The default value is 1000.
outputimage : keyword option of the form outputimage=img where img is a color image as used by the ImageTools package, with dimensions of height and width. Escape will fill img with the generated image defined below.
height : keyword option of the form height=val, where val is a positive integer specifying the height of the image. If outputimage is defined the default value is the height of outputimage. Otherwise, the default value is 500.
width : keyword option of the form width=val, where val is a positive integer specifying the width of the image. If outputimage is defined the default value is the width of outputimage. Otherwise, the default value is 500.
xvariable : keyword option of the form xvariable=param, where param is a name specifying the parameter in exprs and/or init that will be varied along the horizontal axis. The default value is x
yvariable : keyword option of the form yvariable=param, where param is a name specifying the parameter in exprs and/or init that will be varied along the vertical axis. The default value is y
loopvariable : keyword option of the form loopvariable=var, where var is a name specifying the variable representing the current iteration index. The default value is i
redvariable : keyword option of the form redvariable=var, where var is a name specifying the red color variable at the current position in the image. The default value is R
greenvariable : keyword option of the form greenvariable=var, where var is a name specifying the green color variable at the current position in the image. The default value is G
bluevariable : keyword option of the form bluevariable=var, where var is a name specifying the blue color variable at the current position in the image. The default value is B
redexpression : keyword option of the form redexpression=expr, where expr is an algebraic expression defining the coloring procedure of the red color value at the current position the image. If redexpression=null then no procedure is applied to the red value at the current point. The default value is loopvariable
greenexpression : keyword option of the form greenexpression=expr, where expr is an algebraic expression defining the coloring procedure of the green color value at the current position the image. If greenexpression=null then no procedure is applied to the green value at the current point. The default value is null
blueexpression : keyword option of the form blueexpression=expr, where expr is an algebraic expression defining the coloring procedure of the blue color value at the current position the image. If blueexpression=null then no procedure is applied to the blue value at the current point.The default value is null
The Escape module computes the escape values of an iterative function (xvariable against yvariable) being applied iterations times at equally spaced (xvariable,yvariable) values, and constructs an image of the results.
The image is an Array with dimensions height * width * 3 and with float[8] datatype, which corresponds to a color image in the context of the ImageTools package.
Within the domain [xmin, xmax] x [ymin, ymax], (xvariable, yvariable) values will be selected at equally spaced intervals.
For each (xvariable, yvariable) value, starting at the point X0=init in ℝN, where N is the number of variables in vars, the sequence Xn=F⁡Xn−1, 0 ≤n≤iterations, is generated.
The function F:ℝn→ℝn, is defined by the following algorithm:
Start at the point Xn=Xn,1,..,Xn,N, j=1
Apply the function Fj to the current point: y=Fj⁡Xn
Replace the jth component of Xn with y: Xn=Xn,1,..,Xn,j−1,y,..,Xn,N
Increment j by 1, j=j+1 and repeat the process with the new Xn. Stop when j=N+1, where N is the number of variables in vars.
Each Fj is defined by evaluating exprlistj at the current values of the variables in vars.
If given an exprlistlist, then one of the functions in exprlistlist will be randomly selected to be applied to Xn, for each 0 ≤n≤iterations-1. The probability that the ith function defined in exprlistlist is applied to Xn is equal to probabilitiesi∑i=1N⁡probabilitiesi.
Whenever this process yields a point Xn, the escapecond is examined. If escapecond is true, then the expressions redexpression, greenexpression, blueexpression are evaluated, substituting the values Xn,1,...,Xn,N for the variables vars1,...,varsN, and the current red, green, and blue values of the pixel, corresponding to the point (xvariable, yvariable), for the variables redvariable, greenvariable, and bluevariable, respectively.
The red, green, and blue values of the pixel are then updated to the newly evaluated values, and the algorithm is repeated on the next (xvariable, yvariable).
If a coloring expression is null then the color, corresponding to the expression, of the pixel will be unchanged
Note that redexpression, greenexpression, blueexpression are applied to an image as defined by ImageTools:-Image, thus the minimum and maximum color values are 0 and 1 respectively.
Escape returns an image described above, as an Array. Further coloring procedures, defined in ImageTools, can be applied to the Array.
The defaults for options redexpression, greenexpression, and blueexpression generate an image that is suitable for use with ImageTools:-ColouringProcedures:-HueToRGB.
with⁡IterativeMaps:with⁡ImageTools:
z≔zr+zi⁢I4
z≔zr+I⁢zi4
fzi≔evalc⁡ℑ⁡z
fzi≔−4⁢zi3⁢zr+4⁢zi⁢zr3
fzr≔evalc⁡ℜ⁡subs⁡zi=zit,z
fzr≔zit4−6⁢zit2⁢zr2+zr4
mandelbroid≔Escape⁡zi,zr,zit,zrsqr,zisqr,fzi+y,fzr+x,zi,zr2,zi2,y,x,y,x2,y2,25<zrsqr+zisqr,−1.4,1.0,−1.2,1.2,iterations=3000,redexpression=i:
ArrayTools:-Dimensions⁡mandelbroid
1..500,1..500,1..3
ColouringProcedures:-HueToRGB⁡mandelbroid:Embed⁡mandelbroid
Hopalong≔Escape⁡x1,x2,tx1,x2−signum⁡x1⁢sqrt⁡abs⁡1.1⁢x1−3,3.7−tx1,x1,x,y,x,150<x12+x22,−20,20,−20,20,iterations=5000,redexpression=i,greenexpression=sqrt⁡x12+x22:
ArrayTools:-Dimensions⁡Hopalong
Hopalong≔Create⁡Fractals:-EscapeTime:-Colorize⁡500,Hopalong,Array⁡2,3,7,datatype=integer4,Array⁡0.25,0.75,0.25,datatype=float8,rgb=0,mode=4,layer=2,fit=true:Embed⁡Hopalong
The IterativeMaps:-Escape command was introduced in Maple 2015.
For more information on Maple 2015 changes, see Updates in Maple 2015.
See Also
Array
Escape Fractals
ImageTools
Download Help Document