(*^ ::[ frontEndVersion = "Macintosh Mathematica Notebook Front End Version 2.1"; macintoshStandardFontEncoding; paletteColors = 128; automaticGrouping; currentKernel; fontset = title, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeTitle, center, M7, bold, e8, 24, "Times"; ; fontset = subtitle, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeTitle, center, M7, bold, e6, 18, "Times"; ; fontset = subsubtitle, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeTitle, center, M7, italic, e6, 14, "Times"; ; fontset = section, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeSection, grayBox, M22, bold, a20, 18, "Times"; ; fontset = subsection, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeSection, blackBox, M19, bold, a15, 14, "Times"; ; fontset = subsubsection, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeSection, whiteBox, M18, bold, a12, 12, "Times"; ; fontset = text, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, "Times"; ; fontset = smalltext, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 10, "Times"; ; fontset = input, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeInput, M42, N23, bold, L-5, 12, "Courier"; ; fontset = output, output, inactive, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeOutput, M42, N23, L-5, 12, "Courier"; ; fontset = message, inactive, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeOutput, M42, N23, R65535, L-5, 12, "Courier"; ; fontset = print, inactive, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeOutput, M42, N23, L-5, 12, "Courier"; ; fontset = info, inactive, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeOutput, M42, N23, B65535, L-5, 12, "Courier"; ; fontset = postscript, PostScript, formatAsPostScript, output, inactive, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeGraphics, M7, l34, w282, h287, 12, "Courier"; ; fontset = name, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, italic, 10, "Geneva"; ; fontset = header, inactive, noKeepOnOnePage, preserveAspect, M7, 12, "Times"; ; fontset = leftheader, inactive, L2, 12, "Times"; ; fontset = footer, inactive, noKeepOnOnePage, preserveAspect, center, M7, 12, "Times"; ; fontset = leftfooter, inactive, L2, 12, "Times"; ; fontset = help, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 10, "Times"; ; fontset = clipboard, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, "Times"; ; fontset = completions, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, "Times"; ; fontset = special1, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, "Times"; ; fontset = special2, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, "Times"; ; fontset = special3, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, "Times"; ; fontset = special4, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, "Times"; ; fontset = special5, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, "Times"; ; ] :[font = special1; inactive; preserveAspect; ] Looking at a Three Dimensional World with Two Dimensional Eyes The following cell illustrates Mathematica notation for vectors and the dot product and how the magnitude of a vector can be defined using the dot product. Evaluate it now. ;[s] 6:0,1;72,0;105,2;116,0;232,3;247,0;249,-1; 4:3,13,9,Times,0,12,0,0,0;1,13,9,Times,1,12,0,0,0;1,13,9,Times,2,12,0,0,0;1,13,9,Times,1,12,65535,0,0; :[font = input; preserveAspect; ] Clear[U, V] U := {1, 2, 3} V := {3, 4, 5} U.V Mag[x_] := Sqrt[x.x] Mag[U] :[font = special1; inactive; preserveAspect; ] The following cell illustrates how Mathematica can be used to find the point where two lines "intersect" even when they don't exactly intersect because of measurement error. Evaluate it now. ;[s] 5:0,0;35,1;46,0;176,2;191,0;193,-1; 3:3,13,9,Times,0,12,0,0,0;1,13,9,Times,2,12,0,0,0;1,13,9,Times,1,12,65535,0,0; :[font = input; preserveAspect; ] Clear[V, G, L, S, Ft, Fs, P, answer] V = {0, 0, 105}; (* Viewpoint *) G = {3.20, 4.20, 0}; (* apparent location on ground *) L = {-105, 0, 105}; (* Light source *) S = {8.3, 4.3, 0}; (* Shadow *) (* The next lines define the function f(s, t) *) P[s_, t_] = t L + (1 - t) S - (s V + (1 - s) G); F[s_, t_] = P[s, t] . P[s, t]; Ft[s_, t_] = D[F[s, t], t]; (* partial F / partial t *) Fs[s_, t_] = D[F[s, t], s]; (* partial F / partial s *) (* The next line find the values of s and t that make *) (* both partial derivatives zero. *) answer = Solve[{Ft[s, t] == 0, Fs[s, t] == 0}, {s, t}]; (* The next line finds the point half-way between the *) (* closest points on the two lines. This is the *) (* that we seek. *) 0.5 * (t L + (1 - t) S + s V + (1 - s) G) /. answer ;[s] 19:0,0;61,1;94,0;118,1;151,0;175,1;208,0;232,1;265,0;267,1;324,0;436,1;463,0;493,1;520,0;522,1;635,0;701,1;871,0;925,-1; 2:10,12,10,Courier,1,12,0,0,0;9,12,10,Courier,1,12,0,0,65535; :[font = special1; inactive; preserveAspect; ] In the next cell we first define the points and rods for the pyramid used as an example in this module. Then we define a procedure LookAt that draws the picture taken by a camera from a particular viewpoint. Evaluate the next cell now and then look at this pyramid from various different points-of-view. Then use the same ideas to draw the pictures taken by a camera looking at your Tinkertoy house from various points-of-view. Use your own measurments. ;[s] 5:0,0;133,2;139,0;212,1;458,0;460,-1; 3:3,13,9,Times,0,12,0,0,0;1,13,9,Times,1,12,65535,0,0;1,13,9,Times,1,12,0,0,0; :[font = input; preserveAspect; ] Clear[AA, BB, CC, DD, TT, Points, Rods] AA = {-1, 0, 0}; BB = { 1, 0, 0}; CC = { 0, 1, 0}; DD = { 0, -1, 0}; TT = { 0, 0, 1}; Points = {AA, BB, CC, DD, TT}; Rods = {{AA, CC}, {CC, BB}, {BB, DD}, {DD, AA}, {AA, TT}, {BB, TT}, {CC, TT}, {DD, TT}}; LookAt[theta_, R_, H_] := Block[{u = {-Sin[theta], Cos[theta], 0}, v = {-H Cos[theta]/Sqrt[H^2 + R^2], -H Sin[theta]/Sqrt[H^2 + R^2], R/Sqrt[H^2 + R^2]}}, Show[Graphics[{PointSize[0.02], Join[ Table[Point[{u . Points[[k]], v . Points[[k]]}], {k, 1, Length[Points]}], Table[Line[{{u . Rods[[k]][[1]], v . Rods[[k]][[1]]}, {u . Rods[[k]][[2]], v . Rods[[k]][[2]]}}], {k, 1, Length[Rods]}] ]}], AspectRatio -> Automatic]] LookAt[Pi/8, 100, 75] ^*)