Wolfram ResearchProductsPurchasingServices & ResourcesAbout UsOur Sites
Geometrica05 Products
-----
 /
Geometrica
*Contents
*New Improvements
<Tour of Geometrica
*Educational Examples
*References
*Buy Online
*For More Information
*Higher Education Solutions
*Precollege Education Solutions
*Ask about this page
*Print this page
*Email this page
*Give us feedback
*
Sign up for our newsletter:

Tour of Geometrica

This version of Geometrica expands the features highlighted in Versions 97 and 02. In this tour, we demonstrate controlling the display of the steps of parabola construction with the option DisplayOn, we use the newly introduced Cartesian representation in the treatment of parabolic cylinders, and we describe helicoidal staircases and give an example of a Bézier surface for CAD applications.


Calling Geometrica

Each time you need Geometrica, execute the following command.

In[1]:=

<<Geometrica`Geometrica05`

To see the results of the commands contained in the Mathematica notebook version* of this document, or any other notebook of the Geometrica documentation, execute the input cells sequentially. If you forget to do so, you may have to deal with undefined variables.


Geometrica versus Cabri or Sketchpad

Features Cabri or Sketchpad Geometrica
Interactivity Mouse Keyboard or palette
Geometry Euclidean Analytical
Functions ++ ++++
Multiple objects No Yes
Abstract objects No Yes
Geometrical functions No Yes

Features of Geometrica and Mathematica

  • List processing
  • Symbolic facilities
  • Functional programming
  • Draw and Draw3D commands
  • Many new geometrical functions

Euclidean and Analytical Geometries

  • Primary concept in Euclidean geometry: CPoint
  • Primary concept in analytical geometry: Coordinates


Solution of an Elementary Problem

The best starting point consists of choosing a simple problem and seeing how it is solved. We shall generate a parabola as the envelope of one edge of a square ruler whose vertex describes a line and whose other edge passes through a fixed point.


Point, Line, and First Drawing

In[2]:=

m = CPoint[1, 0]

Out[2]=

CPoint[1, 0]

The straight line is the y-axis.

In[3]:=

d = CLine[1, 0, 0] g1 = Draw[Red, m, d] ;

Out[3]=

CLine[1, 0, 0]

[Graphics:HTMLFiles/functions_6.gif]


Bound Point and Euclidean Line

The edge passing through m is defined by a second point bound to d.

In[5]:=

m_1 = Pointer[d, t] d_1 = ELine[m, m_1]

Out[5]=

CPoint[0, -t]

Out[6]=

CLine[t, -1, -t]

The next drawings are not displayed; they will serve later to show the various steps of the construction. The option DisplayOn → False replaces the Mathematica function DisplayFunction → Identity.

In[7]:=

r = t1 ; g2 = Draw[Blue, m_1/.r, DisplayOnFalse] ; g3 = Draw[Blue, d_1/.r, DisplayOnFalse] ;


Geometrical Function

The other edge, d2, is perpendicular in m1 to d1.

In[10]:=

d_2 = ELine[m_1, d_1] g4 = Draw[Blue, d_2/.r, DisplayOnFalse] ;

Out[10]=

CLine[1, t, t^2]


Derivative of a Geometrical Function

When the parameter t varies, the line d2 moves between two infinitesimally close positions. The two lines intersect at a point of the envelope.

In[12]:=

d_21 = D[#, t] &/@d_2 g5 = Draw[Blue, d_21/.r, DisplayOnFalse] ; m_p = d_2⋂d_21 g6 = Draw[Red, m_p/.r, DisplayOnFalse] ;

Out[12]=

CLine[0, 1, 2 t]

Out[14]=

CPoint[t^2, -2 t]


Animation and Storyboard

We can now recapitulate the construction by using the command Movie, which produces the six figures by integrating the n+1th figure to the nth one. Double-clicking on the right-hand bracket that covers all the cells regroups the cells into a single bracket. Then we can animate the film with the command Cell`AnimateSelectedGraphics.

In[16]:=

Movie[g1, g2, g3, g4, g5, g6] ;

[Graphics:HTMLFiles/functions_23.gif] To view the full movie, download the Mathematica notebook version of this tour.*

The movie is adapted to a demo but, to keep the trace of the construction, it is more appropriate to use StoryBoard, which puts the figures in a table. The last graph recapitulates all the construction.

In[17]:=

StoryBoard[{g1, g2, g3, g4, g5, g6}, 3] ;

[Graphics:HTMLFiles/functions_36.gif] To view the full movie, download the Mathematica notebook version of this tour.*


Viewing the Envelope Process

We are now curious to see the motion of the line d2. We make a table of the graph of the line for a whole range of t.

In[18]:=

g7 = Table[Draw[Red, LineOrigin[m], d_2, DisplayOnFalse], {t, -2, 2, .2}] ; g8 = Movie[g7] ;

[Graphics:HTMLFiles/functions_45.gif] To view the full movie, download the Mathematica notebook version of this tour.*

Study of a Conic

To find the equation of the envelope, we eliminate t from the coordinates of mp.

In[20]:=

l_1 = {x, y} ; l_2 = List @@ m_p ; eqs = Thread[Equal[l_1, l_2]] ; eq = Eliminate[eqs, t]

Out[23]=

y^24 x

Geometrica can recognize the nature of the conic from its Cartesian equation,
r x2 + 2 s x y + t y2 + 2 u x + 2 v y + w = 0.

In[24]:=

p = CConic[0, 0, 1, -2, 0, 0]

Out[24]=

Parabola[0, 0, 1/2, -1, 0, 0]

and determine its focus and directrix.

In[25]:=

{f, Δ} = {Foci[p], Directrices[p]}

Out[25]=

{{CPoint[1, 0]}, {CLine[1, 0, 1]}}


Summary

The parabola is drawn with its directrix and focus, and the previous graph is added in Show.

In[26]:=

g9 = Draw[Thickness[.01], Green, p, f, Δ, Black, Legend[{"f", "Δ"}, {f, Δ}]] ; Show[Last[g8], g9] ;

[Graphics:HTMLFiles/functions_76.gif]

[Graphics:HTMLFiles/functions_77.gif]


Illustration in 3D

The previous problem can be visualized in 3D by replacing the parabola with a cylinder with a parabolic directrix.


3D Conic

A 2D object can be converted into a 3D object using the command To3D.

In[28]:=

p3D = To3D[p]

Out[28]=

CConic[Parabola[0, 0, 1/2, -1, 0, 0], CPlane[0, 0, 1, 0]]

The parabola is defined by its 2D representation and located in the horizontal plane. We obtain a point belonging to the parabola using Pointer

In[29]:=

m3D = Pointer[p3D, n]

Out[29]=

CPoint[n^2/4, n, 0]

and the tangents using ELine.

In[30]:=

tg = ELine[m3D, p3D]

Out[30]=

CLine[CPlane[0, 0, 1, 0], CPlane[-4, 2 n, 0, -n^2]]


Cylinder

A cylinder is defined by a curve, here the parabola, and a generator parallel to a fixed direction Oa, where a has been chosen as the point of Oz at height 6. It can be obtained either in parametric or Cartesian form using the option CQuadric. However, the Cartesian form has an internal parametrization that limits the generator to a height of 1.

In[31]:=

{cyp, cyc} = {Cylinder[CPoint[0, 0, 6], p3D], Cylinder[CPoint[0, 0, 6], p3D, CQuadricTrue]}

Out[31]=

{PPoint[#1^2/4&, #1&, 6 #2&, PRange {{-π, π}, {0, 1}, {25, 2}}], ParabolicCylinder[0, 1/2, 0, 0, 0, 0, -1, 0, 0, 0]}

The planes tangent to the parabolic cylinder are represented by parallelograms of vertices: the contact point m3D with the parabola, the point of parameter 0 of the tangents tg to the parabola, and the point of height 6 on the vertical line passing through the contact point.

In[32]:=

a = Pointer[tg, 0]

Out[32]=

CPoint[-n^2/(4 + n^2), n^3/(8 + 2 n^2), 0]

In[33]:=

b = Translate[m3D, CPoint[0, 0, 6]]

Out[33]=

CPoint[n^2/4, n, 6]

The parallelogram is then given.

In[34]:=

pp = Parallelogram[m3D, a, b]

Out[34]=

Segment[CPoint[n^2/4, n, 0], CPoint[-n^2/(4 + n^2), n^3/(8 + 2 n^2), 0], CPoint[-n^2/(4 + n^2), n^3/(8 + 2 n^2), 6], CPoint[n^2/4, n, 6], CPoint[n^2/4, n, 0]]

The full figure can now be drawn.

In[35]:=

ta = Table[pp, {n, -3, 3, .2}] ; Draw3D[Paint[cyp, Red], Blue, ta] ;

[Graphics:HTMLFiles/functions_93.gif]


CAD Functions


Walls as Examples of Parallel Polygons

A line L' is parallel to a line L when it is generated by the end of a segment attached and normal to L. This definition assumes that L represents a continuous and derivable function, which is not true for a polygon that has no normal at a vertex. A convention is introduced in Geometrica to define a parallel polygon. We illustrate it here for the walls of a house.

In[37]:=

x = {0, 1, 3, 4, 4, 5, 7, 8, 8, 8, 8, 0, 0, 0} ; y = {0, 0, 0, 0, 1, 1, 1, 1, 2, 3, 4, 4, 3, 2} ; m = CPoint[x, y] ; s = Close[Segment @@ m] ; s_p = Parallel[s, .3] ; Draw[s, s_p] ;

[Graphics:HTMLFiles/functions_95.gif]

The walls have been defined with openings that can be seen if the option Ribbon is used. The inner polygons of the "ribbon" can be painted to distinguish the solid and open parts of the wall.

In[43]:=

s_p = Parallel[s, .3, RibbonTrue] ; col = {Black, White, Black, Black, Black, White, Black, Black, White, Black, Black, Black, White, Black} ; Draw[Paint[s_p, col]] ;

[Graphics:HTMLFiles/functions_97.gif]


Putting Dimensions on a Technical Drawing

The drawing can be completed by adding the walls' dimensions.

In[46]:=

dim = Dimension[s] ; Draw[Paint[s_p, col], dim] ;

[Graphics:HTMLFiles/functions_99.gif]


Helicoidal Staircase

For the initial view of a helicoidal staircase, we use the default definition.

In[48]:=

sc = HelicoidalStaircase[] ; Draw3D[sc] ;

[Graphics:HTMLFiles/functions_101.gif]

Various variables and options are at hand to parametrize the staircase. The detail of a step is shown by drawing 1/36 of the full staircase, whose stair width is equal to 1, pitch is 1, and angular step is pi/18. Each stair has a thickness and a recess that have optional values. Optional also are the direction of rotation, the inner radius, and the initial angle. The stair is represented here from two opposite viewpoints.

In[50]:=

stair = HelicoidalStaircase[1, 1, 1/36, Pi/18] ; Draw3D[Paint[List @@ stair, {GrayLevel[.4], G ... el[.6], GrayLevel[.4]}], #] &/@{ViewPoint {-5, -5, 5}, ViewPoint {5, 5, 5}} ;

[Graphics:HTMLFiles/functions_105.gif]

[Graphics:HTMLFiles/functions_106.gif]


Optics Functions and Offset

The function Paraxial in Geometrica is inspired by optics, but it is also common in CAD applications, where it is called Offset. Paraxial lines are generated in the same way as parallel lines, but the distance between the lines varies according to a prescribed function.

In[52]:=

{m1, m2} = CPoint[{0, 1}, 0] ; c = ECircle[m1, m2] RowBox[{l, =, RowBox[{Paraxial, [, RowBox[{ ... RowBox[{Sin, [, RowBox[{2.,  , 2, π,  , #}], ]}]}], &}]}], ]}]}] Draw[Blue, c, Red, l] ;

Out[53]=

Ellipse[1, 0, 1, 0, 0, -1]

Out[54]=

RowBox[{PPoint, [, RowBox[{RowBox[{RowBox[{Cos[#1], -, RowBox[{0.1,  , Cos[#1],  , RowBox[{Sin ... Sin, [, RowBox[{12.5664,  , #1}], ]}]}]}], &}], ,, PRange {-π, π, 25}}], ]}]

[Graphics:HTMLFiles/functions_110.gif]

The shape of the paraxial line may be more elaborate for larger amplitudes of the oscillation.

In[56]:=

RowBox[{RowBox[{l, =, RowBox[{Paraxial, [, RowBox[{c, ,, RowBox[{RowBox[{Sin, [, RowBox[{2.,  , 2, π,  , #}], ]}], &}]}], ]}]}], ;}] Draw[Blue, c, Red, l, PlotRange->All] ;

[Graphics:HTMLFiles/functions_112.gif]

In[58]:=

RowBox[{RowBox[{l, =, RowBox[{Paraxial, [, RowBox[{c, ,, RowBox[{RowBox[{2,  , RowBox[{Sin, [, ... 2.,  , 2, π,  , #}], ]}]}], &}]}], ]}]}], ;}] Draw[Blue, c, Red, l, PlotRange->All] ;

[Graphics:HTMLFiles/functions_114.gif]

In Geometrica05, the functions Parallel and Paraxial have been extended to any curve or surface. This is the paraxial curve of a helix.

In[60]:=

h = PPoint[2Cos[#] &, 2Sin[#] &, #&, PRange {0, 4Pi, 50}] ; RowBox[{l, =,  ... wBox[{Sin, [, RowBox[{8.,  , 2, π,  , #}], ]}]}], &}]}], ]}]}] Draw3D[Blue, h, Red, l] ;

Out[61]=

RowBox[{PPoint, [, RowBox[{RowBox[{RowBox[{2 Cos[#1], -, RowBox[{2,  , Cos[#1],  , RowBox[{Sin ... RowBox[{50.2655,  , #1}], ]}]}]}], &}], ,, #1&, ,, PRange {0, 4 π, 50}}], ]}]

[Graphics:HTMLFiles/functions_117.gif]

Paraxial surfaces can also be obtained by modulating one or both parameters. This is a cylinder whose elliptic base is deformed by a sine function.

In[63]:=

s = EllipticCylinder[] fu = Sin[#1] & sp = Paraxial[s, fu] Draw3D @ Paint[sp] ;

Out[63]=

EllipticCylinder[1/2, 1, 0, 0, 0, 0, 0, 0, 0, -1/2]

Out[64]=

Sin[#1] &

Out[65]=

PPoint[Cos[#1] + (2^(1/2) Cos[#1] Sin[#1])/(3 - Cos[2 #1])^(1/2) &, Sin[#1]/2^(1/2) + (2 S ... [#1]^2)/(3 - Cos[2 #1])^(1/2) &, #2&, PRange {{-π, π}, {0, 1}, {25, 2}}]

[Graphics:HTMLFiles/functions_122.gif]

The generators only are now modified using the second variable.

In[67]:=

RowBox[{fv, =, RowBox[{RowBox[{1.2,  , #2}], &}]}] sp = Paraxial[s, fv] Draw3D @ Paint[sp] ;

Out[67]=

RowBox[{RowBox[{1.2,  , #2}], &}]

Out[68]=

RowBox[{PPoint, [, RowBox[{RowBox[{RowBox[{Cos[#1], +, RowBox[{RowBox[{(, RowBox[{1.69706,  ,  ... #1])^(1/2)}]}], &}], ,, #2&, ,, PRange {{-π, π}, {0, 1}, {25, 2}}}], ]}]

[Graphics:HTMLFiles/functions_126.gif]

The original cylinder is now subjected to the product of the two previous paraxial functions.

In[70]:=

RowBox[{fuv, =, RowBox[{RowBox[{1.2,  , #2, Sin[#1]}], &}]}] sp = Paraxial[s, fuv] Draw3D @ Paint[sp] ;

Out[70]=

RowBox[{RowBox[{1.2,  , #2,  , Sin[#1]}], &}]

Out[71]=

RowBox[{PPoint, [, RowBox[{RowBox[{RowBox[{Cos[#1], +, RowBox[{RowBox[{(, RowBox[{1.69706,  ,  ... #1])^(1/2)}]}], &}], ,, #2&, ,, PRange {{-π, π}, {0, 1}, {25, 2}}}], ]}]

[Graphics:HTMLFiles/functions_130.gif]


Bézier Surface

The preceding surface can be fitted using a Bézier fit. Drawing the reference surface in yellow and the Bézier surface in the default color in the same graph shows how faithful the fit is.

In[73]:=

m = Table[Pointer[sp, u, v], {u, -Pi, Pi, .2}, {v, 0, 1, .1}] ; be = Bezier[m] ; Draw3D[Paint[sp, Yellow], Paint[be]] ;

[Graphics:HTMLFiles/functions_132.gif]


*   If you don't yet have Mathematica, you can download the free Mathematica Player to explore this notebook and other features.



 © 2008 Wolfram Research, Inc.  Terms of Use  Privacy Policy