(*^ ::[ Information = "This is a Mathematica Notebook file. It contains ASCII text, and can be transferred by email, ftp, or other text-file transfer utility. It should be read or edited using a copy of Mathematica or MathReader. If you received this as email, use your mail application or copy/paste to save everything from the line containing (*^ down to the line containing ^*) into a plain text file. On some systems you may have to give the file a name ending with ".ma" to allow Mathematica to recognize it as a Notebook. The line below identifies what version of Mathematica created this file, but it can be opened using any other version as well."; FrontEndVersion = "Macintosh Mathematica Notebook Front End Version 2.2"; MacintoshStandardFontEncoding; fontset = title, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeTitle, center, M7, bold, L3, e8, 24, "New York"; fontset = subtitle, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeTitle, center, M7, bold, L2, e6, 18, "New York"; fontset = subsubtitle, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeTitle, center, M7, bold, L2, e6, 14, "New York"; fontset = section, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeSection, grayBox, M22, bold, L2, a20, 14, "New York"; fontset = subsection, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeSection, blackBox, M19, bold, L2, a15, 12, "New York"; fontset = subsubsection, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeSection, whiteBox, M18, bold, L2, a12, 10, "New York"; fontset = text, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, L2, 12, "New York"; fontset = smalltext, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, L2, 10, "New York"; fontset = input, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeInput, M42, N23, bold, L2, 12, "Courier"; fontset = output, output, inactive, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeOutput, M42, N23, L2, 12, "Courier"; fontset = message, inactive, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeOutput, M42, N23, R65535, L2, 12, "Courier"; fontset = print, inactive, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeOutput, M42, N23, L2, 12, "Courier"; fontset = info, inactive, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeOutput, M42, N23, L2, 12, "Courier"; fontset = postscript, PostScript, formatAsPostScript, output, inactive, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeGraphics, M7, l34, w282, h287, L2, 12, "Courier"; fontset = name, inactive, nowordwrap, nohscroll, noKeepOnOnePage, preserveAspect, M7, italic, B65535, L2, 10, "Geneva"; fontset = header, inactive, noKeepOnOnePage, preserveAspect, M7, L2, 10, "Times"; fontset = leftheader, inactive, L2, 10, "Times"; fontset = footer, inactive, noKeepOnOnePage, preserveAspect, center, M7, L2, 12, "Times"; fontset = leftfooter, inactive, center, L2, 12, "Times"; fontset = help, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, L2, 10, "Geneva"; fontset = clipboard, inactive, noKeepOnOnePage, preserveAspect, M7, L2, 12, "New York"; fontset = completions, inactive, nowordwrap, noKeepOnOnePage, preserveAspect, M7, L2, 12, "New York"; fontset = special1, inactive, nowordwrap, noKeepOnOnePage, preserveAspect, M7, L2, 12, "New York"; fontset = special2, inactive, nowordwrap, noKeepOnOnePage, preserveAspect, center, M7, L2, 12, "New York"; fontset = special3, inactive, nowordwrap, noKeepOnOnePage, preserveAspect, right, M7, L2, 12, "New York"; fontset = special4, inactive, nowordwrap, noKeepOnOnePage, preserveAspect, M7, L2, 12, "New York"; fontset = special5, inactive, nowordwrap, noKeepOnOnePage, preserveAspect, M7, L2, 12, "New York"; paletteColors = 128; currentKernel; ] :[font = input; preserveAspect] (* Set up graphics *) :[font = input; dontPreserveAspect; startGroup] (* Box graphic *) ed=0.5; xdis= 0.; ydis=0.25; box= Graphics3D[ { EdgeForm[ GrayLevel[0]], FaceForm[GrayLevel[1],GrayLevel[1]], Polygon[ { {xdis,ydis,0},{xdis,ydis+ed,0}, {xdis+ed,ydis+ed,0},{xdis+ed,ydis,0} } ], Polygon[ { {xdis,ydis,ed},{xdis,ydis+ed,ed}, {xdis+ed,ydis+ed,ed},{xdis+ed,ydis,ed} } ], Polygon[ { {xdis,ydis,0},{xdis,ydis+ed,0}, {xdis,ydis+ed,ed},{xdis,ydis,ed} } ], Polygon[ { {xdis,ydis,0},{xdis+ed,ydis,0}, {xdis+ed,ydis,ed},{xdis,ydis,ed} } ], Polygon[ { {xdis+ed,ydis,0},{xdis+ed,ydis+ed,0}, {xdis+ed,ydis+ed,ed},{xdis+ed,ydis,ed} } ], Polygon[ { {xdis,ydis+ed,0},{xdis+ed,ydis+ed,0}, {xdis+ed,ydis+ed,ed},{xdis,ydis+ed,ed} } ] } ] :[font = message; inactive; preserveAspect] General::spell1: Possible spelling error: new symbol name "ydis" is similar to existing symbol "xdis". :[font = output; output; inactive; dontPreserveAspect] Graphics3D["<<>>"] ;[o] -Graphics3D- :[font = input; dontPreserveAspect; startGroup] (* C shape graphic *) ydisc=0.; cshape= Graphics3D[ { Polygon[{ {ed,ed+ydisc,-ed},{-ed,ed+ydisc,-ed}, {-ed,ed+ydisc,0},{ed,ed+ydisc,0} } ], Polygon[{ {ed,ed+ydisc,ed},{-ed,ed+ydisc,ed}, {-ed,ed+ydisc,2 ed},{ed,ed+ydisc,2 ed} } ], Polygon[{ {0,ed+ydisc,0},{-ed,ed+ydisc,0}, {-ed,ed+ydisc,ed},{0,ed+ydisc,ed} } ], Polygon[{ {ed,ydisc,-ed},{-ed,ydisc,-ed},{-ed,ydisc,0}, {ed,ydisc,0} } ], Polygon[{ {ed,ydisc,ed},{-ed,ydisc,ed},{-ed,ydisc,2 ed}, {ed,ydisc,2 ed} } ], Polygon[{ {0,ydisc,0},{-ed,ydisc,0},{-ed,ydisc,ed}, {0,ydisc,ed} } ], Polygon[{ {ed,ed+ydisc,ed},{ed,ed+ydisc,2 ed}, {ed,ydisc,2 ed},{ed,ydisc, ed} } ], Polygon[{ {ed,ed+ydisc,2 ed}, {-ed,ed+ydisc,2 ed}, {-ed,ydisc,2 ed},{ed,ydisc,2 ed} } ], Polygon[{ {ed,ed+ydisc,-ed},{ed,ed+ydisc,0}, {ed,ydisc,0},{ed,ydisc, -ed} } ], Polygon[{ {ed,ed+ydisc,-ed},{-ed,ed+ydisc,-ed}, {-ed,ydisc,-ed},{ed,ydisc,-ed} } ], Polygon[{ {-ed,ed+ydisc,-ed},{-ed,ed+ydisc,2 ed}, {-ed,ydisc,2 ed},{-ed,ydisc,-ed} } ], Polygon[{ {ed,ed+ydisc,-ed},{-ed,ed+ydisc,-ed}, {-ed,ydisc,-ed},{ed,ydisc,-ed} } ], Polygon[{ {ed,ed+ydisc,ed},{0,ed+ydisc,ed}, {0,ydisc,ed},{ed,ydisc,ed} } ], Polygon[{ {ed,ed+ydisc,0},{0,ed+ydisc,0}, {0,ydisc,0},{ed,ydisc,0} } ], Polygon[{ {0,ed+ydisc,0},{0,ed+ydisc,ed}, {0,ydisc,ed},{0,ydisc,0} } ] } ] :[font = message; inactive; preserveAspect] General::spell1: Possible spelling error: new symbol name "ydisc" is similar to existing symbol "ydis". :[font = output; output; inactive; dontPreserveAspect; endGroup; endGroup] Graphics3D["<<>>"] ;[o] -Graphics3D- :[font = input; dontPreserveAspect; startGroup] (* define a frame so that the animation doesn't jump about *) ed=1; fs= ed 3.; fsy= ed 3.; frame= Graphics3D[ { PointSize[0.00001], Point[{-fs,-fs,-fs}], Point[{fs,-fs,-fs}], Point[{fs,fsy,-fs}], Point[{-fs,fsy,-fs}], Point[{-fs,-fs,fs}], Point[{fs,-fs,fs}], Point[{fs,fsy,fs}], Point[{-fs,fsy,fs}] } ] :[font = message; inactive; preserveAspect] General::spell1: Possible spelling error: new symbol name "frame" is similar to existing symbol "Frame". :[font = output; output; inactive; preserveAspect; endGroup] Graphics3D["<<>>"] ;[o] -Graphics3D- :[font = input; dontPreserveAspect] (* Animation with Box moving *) Clear[ydis]; ed=0.5; xdis= 0.; Do[ box= Graphics3D[ { EdgeForm[ GrayLevel[0]], Polygon[ { {xdis,ydis,0},{xdis,ydis+ed,0}, {xdis+ed,ydis+ed,0},{xdis+ed,ydis,0} } ], Polygon[ { {xdis,ydis,ed},{xdis,ydis+ed,ed}, {xdis+ed,ydis+ed,ed},{xdis+ed,ydis,ed} } ], Polygon[ { {xdis,ydis,0},{xdis,ydis+ed,0}, {xdis,ydis+ed,ed},{xdis,ydis,ed} } ], Polygon[ { {xdis,ydis,0},{xdis+ed,ydis,0}, {xdis+ed,ydis,ed},{xdis,ydis,ed} } ], Polygon[ { {xdis+ed,ydis,0},{xdis+ed,ydis+ed,0}, {xdis+ed,ydis+ed,ed},{xdis+ed,ydis,ed} } ], Polygon[ { {xdis,ydis+ed,0},{xdis+ed,ydis+ed,0}, {xdis+ed,ydis+ed,ed},{xdis,ydis+ed,ed} } ] } ]; If[ ydis <= 2 ed, Show[box,cshape,frame, Boxed->False, BoxRatios->{1,1,1}, PlotRange->All, ViewPoint->{100,20,50}], Show[cshape,frame, Boxed->False, BoxRatios->{1,1,1}, PlotRange->All, ViewPoint->{100,20,50}] ], {ydis,-2 ed,3 ed,0.25 ed} ] :[font = input; dontPreserveAspect] (* Animation with both box and C shape moving *) ed=0.5; xdis= 0.; Do[ box= Graphics3D[ { EdgeForm[ GrayLevel[0]], Polygon[ { {xdis,ydis,0},{xdis,ydis+ed,0}, {xdis+ed,ydis+ed,0},{xdis+ed,ydis,0} } ], Polygon[ { {xdis,ydis,ed},{xdis,ydis+ed,ed}, {xdis+ed,ydis+ed,ed},{xdis+ed,ydis,ed} } ], Polygon[ { {xdis,ydis,0},{xdis,ydis+ed,0}, {xdis,ydis+ed,ed},{xdis,ydis,ed} } ], Polygon[ { {xdis,ydis,0},{xdis+ed,ydis,0}, {xdis+ed,ydis,ed},{xdis,ydis,ed} } ], Polygon[ { {xdis+ed,ydis,0},{xdis+ed,ydis+ed,0}, {xdis+ed,ydis+ed,ed},{xdis+ed,ydis,ed} } ], Polygon[ { {xdis,ydis+ed,0},{xdis+ed,ydis+ed,0}, {xdis+ed,ydis+ed,ed},{xdis,ydis+ed,ed} } ] } ]; ydisc= -ydis; cshape= Graphics3D[ { Polygon[{ {ed,ed+ydisc,-ed},{-ed,ed+ydisc,-ed}, {-ed,ed+ydisc,0},{ed,ed+ydisc,0} } ], Polygon[{ {ed,ed+ydisc,ed},{-ed,ed+ydisc,ed}, {-ed,ed+ydisc,2 ed},{ed,ed+ydisc,2 ed} } ], Polygon[{ {0,ed+ydisc,0},{-ed,ed+ydisc,0}, {-ed,ed+ydisc,ed},{0,ed+ydisc,ed} } ], Polygon[{ {ed,ydisc,-ed},{-ed,ydisc,-ed},{-ed,ydisc,0}, {ed,ydisc,0} } ], Polygon[{ {ed,ydisc,ed},{-ed,ydisc,ed},{-ed,ydisc,2 ed}, {ed,ydisc,2 ed} } ], Polygon[{ {0,ydisc,0},{-ed,ydisc,0},{-ed,ydisc,ed}, {0,ydisc,ed} } ] , Polygon[{ {ed,ed+ydisc,ed},{ed,ed+ydisc,2 ed}, {ed,ydisc,2 ed},{ed,ydisc, ed} } ], Polygon[{ {ed,ed+ydisc,2 ed}, {-ed,ed+ydisc,2 ed}, {-ed,ydisc,2 ed},{ed,ydisc,2 ed} } ], Polygon[{ {ed,ed+ydisc,-ed},{ed,ed+ydisc,0}, {ed,ydisc,0},{ed,ydisc, -ed} } ], Polygon[{ {ed,ed+ydisc,-ed},{-ed,ed+ydisc,-ed}, {-ed,ydisc,-ed},{ed,ydisc,-ed} } ], Polygon[{ {-ed,ed+ydisc,-ed},{-ed,ed+ydisc,2 ed}, {-ed,ydisc,2 ed},{-ed,ydisc,-ed} } ], Polygon[{ {ed,ed+ydisc,-ed},{-ed,ed+ydisc,-ed}, {-ed,ydisc,-ed},{ed,ydisc,-ed} } ], Polygon[{ {ed,ed+ydisc,ed},{0,ed+ydisc,ed}, {0,ydisc,ed},{ed,ydisc,ed} } ], Polygon[{ {ed,ed+ydisc,0},{0,ed+ydisc,0}, {0,ydisc,0},{ed,ydisc,0} } ], Polygon[{ {0,ed+ydisc,0},{0,ed+ydisc,ed}, {0,ydisc,ed},{0,ydisc,0} } ] } ] ; Show[box,cshape,frame, Boxed->False, BoxRatios->{1,1,1}, PlotRange->All, ViewPoint->{100,20,50}], {ydis,-2 ed,3 ed,0.25 ed} ] :[font = input; dontPreserveAspect] (* Animation with C shape moving *) Clear[ydisc]; ed=0.5; xdis= 0.; ydis=0.; box= Graphics3D[ { EdgeForm[ GrayLevel[0]], Polygon[ { {xdis,ydis,0},{xdis,ydis+ed,0}, {xdis+ed,ydis+ed,0},{xdis+ed,ydis,0} } ], Polygon[ { {xdis,ydis,ed},{xdis,ydis+ed,ed}, {xdis+ed,ydis+ed,ed},{xdis+ed,ydis,ed} } ], Polygon[ { {xdis,ydis,0},{xdis,ydis+ed,0}, {xdis,ydis+ed,ed},{xdis,ydis,ed} } ], Polygon[ { {xdis,ydis,0},{xdis+ed,ydis,0}, {xdis+ed,ydis,ed},{xdis,ydis,ed} } ], Polygon[ { {xdis+ed,ydis,0},{xdis+ed,ydis+ed,0}, {xdis+ed,ydis+ed,ed},{xdis+ed,ydis,ed} } ], Polygon[ { {xdis,ydis+ed,0},{xdis+ed,ydis+ed,0}, {xdis+ed,ydis+ed,ed},{xdis,ydis+ed,ed} } ] } ]; Do[ cshape= Graphics3D[ { Polygon[{ {ed,ed+ydisc,-ed},{-ed,ed+ydisc,-ed}, {-ed,ed+ydisc,0},{ed,ed+ydisc,0} } ], Polygon[{ {ed,ed+ydisc,ed},{-ed,ed+ydisc,ed}, {-ed,ed+ydisc,2 ed},{ed,ed+ydisc,2 ed} } ], Polygon[{ {0,ed+ydisc,0},{-ed,ed+ydisc,0}, {-ed,ed+ydisc,ed},{0,ed+ydisc,ed} } ], Polygon[{ {ed,ydisc,-ed},{-ed,ydisc,-ed},{-ed,ydisc,0}, {ed,ydisc,0} } ], Polygon[{ {ed,ydisc,ed},{-ed,ydisc,ed},{-ed,ydisc,2 ed}, {ed,ydisc,2 ed} } ], Polygon[{ {0,ydisc,0},{-ed,ydisc,0},{-ed,ydisc,ed}, {0,ydisc,ed} } ] , Polygon[{ {ed,ed+ydisc,ed},{ed,ed+ydisc,2 ed}, {ed,ydisc,2 ed},{ed,ydisc, ed} } ], Polygon[{ {ed,ed+ydisc,2 ed}, {-ed,ed+ydisc,2 ed}, {-ed,ydisc,2 ed},{ed,ydisc,2 ed} } ], Polygon[{ {ed,ed+ydisc,-ed},{ed,ed+ydisc,0}, {ed,ydisc,0},{ed,ydisc, -ed} } ], Polygon[{ {ed,ed+ydisc,-ed},{-ed,ed+ydisc,-ed}, {-ed,ydisc,-ed},{ed,ydisc,-ed} } ], Polygon[{ {-ed,ed+ydisc,-ed},{-ed,ed+ydisc,2 ed}, {-ed,ydisc,2 ed},{-ed,ydisc,-ed} } ], Polygon[{ {ed,ed+ydisc,-ed},{-ed,ed+ydisc,-ed}, {-ed,ydisc,-ed},{ed,ydisc,-ed} } ], Polygon[{ {ed,ed+ydisc,ed},{0,ed+ydisc,ed}, {0,ydisc,ed},{ed,ydisc,ed} } ], Polygon[{ {ed,ed+ydisc,0},{0,ed+ydisc,0}, {0,ydisc,0},{ed,ydisc,0} } ], Polygon[{ {0,ed+ydisc,0},{0,ed+ydisc,ed}, {0,ydisc,ed},{0,ydisc,0} } ] } ] ; If[ ydisc >= -2 ed, Show[box,cshape,frame, Boxed->False, BoxRatios->{1,1,1}, PlotRange->All, ViewPoint->{100,20,50}], Show[box,frame, Boxed->False, BoxRatios->{1,1,1}, PlotRange->All, ViewPoint->{100,20,50}] ], {ydisc,2 ed,-3 ed,-0.25 ed} ] ^*)