Geometrica

BrunoAutin, CERN, Switzerland

Geometrica versus Cabri or Sketchpad

({{\[Placeholder], 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}})

Geometrica and Mathematica

({{list processing}, {symbolic facilities}, {functional programming}, { Drawcommand}, {many new geometrical functions}})

Euclidean and Analytical geometries

Primary concept in EUCLIDEAN geometry: POINT -> superb reasoning (unfortunately disappearing!)
Primary concept in ANALYTICAL geometry: COORDINATES -> unification of geometry and algebra (Descartes and the theory of curves).

Browsing Geometrica

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

Point, line and first drawing

m = POINT[1, 0]

The straight line is the y-axis

d = STRAIGHT[1, 0, 0]

g1 = Draw[Red, m, d];

Bound point and euclidean line

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

(Subscript[m, 1]) = Pointer[d, t]\(r = t -> 1; 
g2 = Draw[Blue, m\_1 /. r]; 

    d\_1 = Ruler[m, m\_1]\)g3 = Draw[Blue, (Subscript[d, 1]) /. r];

Geometrical function

The other edge (Subscript[d, 2]) is perpendicular in (Subscript[m, 1]) to (Subscript[d, 1.])

(Subscript[d, 2]) = Ruler[(Subscript[m, 1]), (Subscript[d, 1])]g4 = Draw[Blue, (Subscript[d, 2]) /. r];

Derivative of a geometrical function

When the parameter t varies, the line (Subscript[d, 2]) moves.Between two infenitisimally close positions,  
      the two lines intersect  at a point of the envelope.

(Subscript[d, 21]) = D[#, t]&/@(Subscript[d, 2])\(g5 = Draw[Blue, d\_21 /. r]; 
m\_p = d\_2 ⋂ d\_21\)g6 = Draw[Red, (Subscript[m, p]) /. r, DisplayFunction -> Identity];

Animation and story board

One can now recapitulate the construction by using the command Movie which produces the six figures by integrating the figure n+1 to the n-th one.

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

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

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

Viewing the envelope process

We are now curious to see the motion of the line (Subscript[d, 2]). We then make a table of the graph of the line for a whole range of t.

g7 = 
      Table[Draw[Red, LineOrigin[m], (Subscript[d, 2]), 
          DisplayFunction -> Identity], {t, -2, 2, .2}];

g8 = Movie[g7];

Study of a conic

To find the equation of the envelope, we elminate t between the coordinates of (Subscript[m, p]).

\(l\_1 = {x, y}; 
l\_2 = List@@m\_p; 
eqs = Thread[Equal[l\_1, l\_2]]; 
    
eq = Eliminate[eqs, t]\)

Geometrica can recognize the nature of the conic from its cartesian equation
r (x^2)  + 2  sx y + t (y^2)  +  2 u x  +  2 v y  +  w  =  0

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

and determine its focus and directrix

{f, Δ} = FocusAndDirectrix[p]

Δ = Simplify[Δ]

Summary

g9 = 
      Draw[Thickness[.01], Green, p, f, Δ, Black, 
        Pen[{"f", "Δ"}, {f, Δ}]];

Show[Last[g8], g9]

New functions

Parallel and paraxial lines

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 defintion assumes that L represents a continuous and derivable function, which is not true for a polygon which has no normal at a vertex. A convention is introduced in Geometica to define a parallel polygon. It is illustrated for the walls of a house.

w =.

\(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\_w = POINT[x, y]; 

    w = POLYGON@@m\_w; 
w\_p = Parallel[w, .3]; 
Draw[w, w\_p]; \)

The wall has been defined with opnings which can be seen if the option Ribbon is used. The inner polygons of the "ribbon" can be painted to distinguish the full and empty parts of the wall.

\(w\_p = Parallel[w, .3, Ribbon -> True]; 

    col = {Black, White, Black, Black, Black, White, Black, Black, White, 
        Black, Black, Black, White, Black}; 
Draw[Paint[w\_p, col]]; \)

The drawing can finally be conpleted with the dimensions of the wall.

\(dim = Dimension[w] /. Arrow[l_LINE] -> Arrow[l, .5]; 

    Draw[Paint[w\_p, col], dim]; \)

Paraxial rays in optics

Paraxial lines are generated in the same way as parallel lines but the distance between the lines varies according to a prescribed function.

\({m1, m2} = POINT[{0, 1}, 0]; 
a = ARC[m1, m2, 2  π]; 

    l = Paraxial[a, .1\ Sin[6.1\ 2  π\ #]&]; 
Draw[Blue, a, Red, l]\)

This is a regular motion, according to the amplitude of the oscillation, the paaxial line may take fancier shapes.

\(l = Paraxial[a, Sin[6.\ 2  π\ #]&]; 

    Draw[Blue, a, Red, l, PlotRange -> All]; \)

\(l = Paraxial[a, 2\ Sin[6.\ 2  π\ #]&]; 

    Draw[Blue, a, Red, l, PlotRange -> All]; \)

Custom composite objects

<< BeamOptics`BeamOptics97`

fd = FODO[Sin[Pi/4], Pi/12, CellLength -> 4]

ch = Compress[BeamLine /. %]

Draw[ch];

Mathematica contest

\(Clear[θ\_0, θ, Leaves, InsertPoint, TreeGraphic]


     (*\ azimuth\ increment\ on\ each\ circle\ *) \)\(θ[k_] = N[2\ π/\((3\ 2^\((k - 1)\))\)]; 


     (*\ initial\ angle\ on\ each\ circle\ *) 
θ\_0[1] = 0; 

    θ\_0[k_] := 
      \(θ\_0[k] = θ\_0[k - 1] - θ[k]/2\); 


     (*\ insert\ a\ point\ in\ a\ segment\ *) 

    Attributes[InsertPoint] = {Listable}\)\(InsertPoint[mp_POINT, LINE[mp1_, mp2_], p_] := 
	p[mp1, mp, mp2]


     (*\ create\ leaves\ between\ two\ circles\ *) \)\(Leaves[{l1_, l2_}, p_] := 
	
      Module[{lp}, 
		lp = \(LINE@@#&\)/@Partition[l2, 2]; 
		
        InsertPoint[l1, lp, p]]

 (*\ create\ tree\ graphics\ *) \)\(TreeGraphic[d_, p_] := 

      Module[{c, col, n, r, pt, pt0, pt1}, 
r = n/d; 
c = CIRCLE[0, 0, r]; 
        
pt = Table[
            Chop@Pointer[c, \((m - 1)\) θ[n] + θ\_0[n]], 

            		\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ {n, d}, 
            \ {m, 3\ 2^\((n - 1)\)}]; 
pt0 = LINE[POINT[0, 0], pt[\([1]\)]]; 
        
pt1 = \(Leaves[#, p]&\)/@Partition[pt, 2, 1]; 

        PrependTo[pt1, pt0]; 
col = Table[Hue[r], {n, d}]; 

        Draw[Paint[pt1, col]]; ]\)

TreeGraphic[6, LINE]

TreeGraphic[6, POLYGON]

TreeGraphic[6, Compass]

TreeGraphic[4, Arc]