(*^ ::[ frontEndVersion = "Microsoft Windows Mathematica Notebook Front End Version 2.2"; microsoftWindowsStandardFontEncoding; fontset = title, "Times", 24, L0, center, nohscroll, bold; fontset = subtitle, "Times", 18, L0, center, nohscroll, bold; fontset = subsubtitle, "Times", 14, L0, center, nohscroll, italic; fontset = section, "Times", 18, L0, nohscroll, bold, grayBox; fontset = subsection, "Times", 14, L0, nohscroll, bold, blackBox; fontset = subsubsection, "Times", 13, L0, nohscroll, B65535; fontset = text, "Times", 12, L0, nohscroll, cellOutline; fontset = smalltext, "Times", 10, L0, nohscroll; fontset = input, "Courier", 12, L-5, nowordwrap, bold; fontset = output, "Courier", 12, L-5, nowordwrap; fontset = message, "Courier", 12, L-5, nowordwrap, R65535; fontset = print, "Courier", 12, L-5, nowordwrap; fontset = info, "Courier", 12, L-5, nowordwrap, B65535; fontset = postscript, "Courier", 12, L0, nowordwrap; fontset = name, "Geneva", 10, L0, nohscroll, italic; fontset = header, "Times", 12, L0; fontset = footer, "Times", 12, L0, center; fontset = help, "Times", 10, L0, nohscroll; fontset = clipboard, "Times", 12, L0, nohscroll; fontset = completions, "Times", 12, L0, nohscroll; fontset = graphics, "Courier New", 10, L0, nowordwrap, nohscroll; fontset = special1, "Times", 12, L0, nohscroll; fontset = special2, "Times", 12, L0, nohscroll; fontset = special3, "Times", 12, L0, nohscroll; fontset = special4, "Times", 12, L0, nohscroll; fontset = special5, "Times", 12, L0, nohscroll; fontset = leftheader, "Times", 12, L2; fontset = leftfooter, "Times", 12, L2; fontset = reserved1, "Courier New", 10, L0, nowordwrap, nohscroll;] :[font = title; inactive; preserveAspect; nohscroll; center; ] MathLive Professional :[font = subsubtitle; inactive; preserveAspect; startGroup; nohscroll; center; ] Solar System Example Original by L.Angrave 1996 Last Update: 20/4/96 :[font = section; inactive; preserveAspect; startGroup; nohscroll; ] Introductory Notes :[font = subsubsection; inactive; preserveAspect; nohscroll; backColorRed = 65535; backColorGreen = 65535; backColorBlue = 65535; fontColorRed = 0; fontColorGreen = 0; fontColorBlue = 65535; plain; fontName = "Times"; fontSize = 13; ] This notebook creates a simple sun-earth-moon system. Each object is built upon the same 3D Graphics created using ParametricPlot3D. :[font = subsubsection; inactive; preserveAspect; nohscroll; backColorRed = 65535; backColorGreen = 65535; backColorBlue = 65535; fontColorRed = 0; fontColorGreen = 0; fontColorBlue = 65535; plain; fontName = "Times"; fontSize = 13; ] The objects are positioned, scaled and colored in MathLive. We then rotate the earth around the sun and the moon around in the earth. :[font = subsubsection; inactive; preserveAspect; endGroup; nohscroll; backColorRed = 65535; backColorGreen = 65535; backColorBlue = 65535; fontColorRed = 0; fontColorGreen = 0; fontColorBlue = 65535; plain; fontName = "Times"; fontSize = 13; ] The initialisation cells create the model but do not run the animation. :[font = section; inactive; initialization; preserveAspect; startGroup; Cclosed; nohscroll; ] Create Objects :[font = input; initialization; preserveAspect; nowordwrap; ] *) Needs["MathLive`MathLive`"]; LaunchLive[]; ResetLive[]; (* :[font = subsubsection; inactive; initialization; preserveAspect; startGroup; nohscroll; ] Stop the default display output from ParametricPlot3D Create the generic sphere for use in this example :[font = input; initialization; preserveAspect; endGroup; nowordwrap; ] *) SetDisplay[ NoteBook -> False, Live-> False]; ballGraphics = ParametricPlot3D[{Sin[u] Cos[v],Sin[u] Sin[v], Cos[u]} , {u,0,Pi} , {v,0,2Pi} ]; (* :[font = subsubsection; inactive; initialization; preserveAspect; startGroup; nohscroll; ] Create the Earth, Moon and Sun objects in MathLive. Each is based upon the above ball graphics, but is given a specific name. This takes a while... Ensure that the Kernel and MathLive each have at least 3Mb free. :[font = input; initialization; preserveAspect; endGroup; nowordwrap; ] *) Live[ Create[ Object3D["Earth" ], ballGraphics ]]; Live[ Create[ Object3D["Moon" ], ballGraphics ]]; Live[ Create[ Object3D["Sun" ], ballGraphics ]]; (* :[font = subsubsection; inactive; initialization; preserveAspect; startGroup; nohscroll; ] Set the planetary distances (not to scale!) :[font = input; initialization; preserveAspect; nowordwrap; ] *) moonSize = 0.2; earthSize = 0.4; emRotationRadius = 0.7 ; (* Earth-Moon distance *) seRotationRadius = 3; (* Sun-Earch distance *) (* :[font = input; initialization; preserveAspect; endGroup; nowordwrap; ] *) Live[ Change[ Object3D["Sun"] , Scale -> 1 , Color -> {Table[ RGBColor[1.,1.,.5 + .5Random[] ], {60}]} , Diffuse -> .0 , Ambient -> .9 , Specular -> 0. , RenderMode -> SmoothShaded , MouseMovement -> False ]]; Live[ Change[ Object3D["Earth"] , Scale -> earthSize , Color -> {Table[ Hue[ If[Random[]>.8,.3,-.3] ] , {60}]} , RenderMode -> SmoothShaded , Location -> {seRotationRadius,0,0} ]]; Live[ Change[ Object3D["Moon"] , Scale -> moonSize , Color -> {Table[GrayLevel[ Random[] ] , {20}]} , RenderMode -> SmoothShaded , Location -> {seRotationRadius+emRotationRadius,0,0} ]]; (* :[font = subsubsection; inactive; initialization; preserveAspect; startGroup; nohscroll; ] Turn the default model bounding box off and the camera icon off :[font = input; initialization; preserveAspect; endGroup; endGroup; nowordwrap; ] *) Live[ Change[ Camera["Camera"] , Visible -> Off , Location -> {0,-8,0} ]]; Live[ Change[ Model3D["Default`"] , BoundingBox -> Off , ModelRange -> seRotationRadius{{-1,-1,-1},{1,1,1}} ]]; (* :[font = section; inactive; initialization; preserveAspect; startGroup; Cclosed; nohscroll; ] Animate :[font = subsubsection; inactive; initialization; preserveAspect; startGroup; nohscroll; ] Create the animation script :[font = input; initialization; preserveAspect; endGroup; nowordwrap; ] *) anim = Table[ { c = Cos[theta ]; s = Sin[theta]; earthPosition = seRotationRadius{c,-s,0}; Change[ Object3D["Moon"] , Euler->{0,0,theta} (* The Earth never sees the other side *) , Location-> earthPosition + emRotationRadius{c,s,0} ] , Change[ Object3D["Earth"] , Location-> earthPosition ] } , {theta,0, 8 Pi, Pi/32} ]; (* :[font = subsubsection; inactive; initialization; preserveAspect; startGroup; nohscroll; ] Finally, send the animation to MathLive :[font = input; initialization; preserveAspect; endGroup; endGroup; nowordwrap; ] *) Live[anim]; (* :[font = section; inactive; preserveAspect; startGroup; nohscroll; ] For further information, advice or suggestions please contact- :[font = text; inactive; preserveAspect; endGroup; endGroup; nohscroll; cellOutline; backColorRed = 65535; backColorGreen = 65535; backColorBlue = 65535; fontColorRed = 0; fontColorGreen = 0; fontColorBlue = 0; plain; fontName = "Times"; fontSize = 12; ] Email: support@milohedge.com Post: Milo Hedge Ltd, The Oxford Centre for Innovation, Mill Street, Oxford, OX2 0JX WWW: http://www.milohedge.com/mathlive/ ^*)