(* This is the file MakeFramesExp.m, written by Douglas N. Arnold Department of Mathematics Penn State University Park, PA 16802 January 1997, June 1997 *) Needs["homotopyframes`"] Needs["Graphics`Colors`"] (* This file makes an animation of a linear homotopy by showing the evolution of the image of a rainbow shaded rectangle. The frames of the evolution are output as GIF files. *) (* STEP 1: DESCRIBE THE DESIRED ANIMATION *) f0[z_]:=z (* initial and final functions *) f1[z_]:=Exp[z] (* of the homotopy *) ll=-2-.975 Pi I; (* lower left and upper right corners of *) ur=-ll; (* the rectangle to be plotted *) llplot=-8-8 I; (* lower left and upper right corners of *) urplot=-llplot; (* plotting region *) nframes=11; (* number of frames in the animation *) vlines=800; (* number of vertical lines (these have varying hue) *) starthue=0; (* starting and ending hues for the vertical lines *) endhue=.9; (* (both should be in [0,1] ) *) vthickness=.001; (* thickness of the vertical lines *) hlines=21; (* number of horizontal grid lines to superimpose *) hgridcolor=Gray; (* color of the horizontal grid lines *) hthickness=.004; (* thickness of the horizontal grid lines *) bdrycolor=White; (* color of the boundary *) bdrythickness=.006; (* thickness of the boundary lines *) pixels=400; (* size of the image in pixels *) prefix="exp"; (* filename prefix *) options = (* general plot options *) {Background->Black, DefaultColor->White, AspectRatio->Automatic}; (* STEP 2: MAKE THE ANIMATION *) homotopyframes[ (* initial function *) f0, (* final function *) f1, (* curvelist *) Join[ (* colored vertical lines *) Table[ line@@Join[{Re[ll]+j(Re[ur]-Re[ll])/(vlines-1)+I Im[ll], Re[ll]+j(Re[ur]-Re[ll])/(vlines-1)+I Im[ur], PlotStyle->{{Thickness[vthickness], Hue[starthue + (endhue-starthue)j/(vlines-1)]}}}, options], {j,0,vlines-1}], (* horizontal grid lines *) hlinearray@@Join[{ll,ur,hlines, PlotStyle->{{Thickness[hthickness],hgridcolor}}}, options], (* boundary *) {rectangle@@Join[{ll,ur, PlotStyle->{{Thickness[bdrythickness],bdrycolor}}}, options]} ], (* number of frames *) nframes, (* pixels *) pixels, (* filename prefix *) prefix, (* options for each frame *) PlotRange->{{Re[llplot],Re[urplot]},{Im[llplot],Im[urplot]}} ]; Print["-- frames written --"]