My Recipie for a Mathematica Easter Egg

March 14th, 2008 | Categories: general math, mathematica | Tags:

1.Take one dare from Kathryn Cramer and obtain a picture from her website.

2. Steal ideas from this demonstration by Jeff Bryant.

3. Type the following incantations into Mathematica

SetDirectory[“/home/mike/Desktop/random”];
image = Import[“kramer.jpg”];
xpos[x_] := Floor[x/N[2/374.] + 377/2.]
ypos[x_] := Floor[x/N[2/499.] + 502/2.]
imcol[x_, y_] := image[[1]][[1]][[xpos[x]]][[ypos[y]]]/256.;
a = 1; b = 0.9; c = 1;
Plot3D[{Sqrt[ c^2*(1 – (x^2/a^2 + y^2/b^2))], -Sqrt[c^2*(1 – (x^2/a^2 + y^2/b^2))]}, {x, -1, 1}, {y, -1, 1}, ColorFunction -> (RGBColor[imcol[#1, #2]] &), Boxed -> False, Axes -> False, AspectRatio -> 2, ViewAngle -> Pi/13, ViewPoint -> {-3.00336, 0.86708, 3.14159}, PlotRange -> All, Mesh -> False, PlotPoints -> 400]

Enjoy!

No comments yet.