Teaching Geometry to my 12-year old Grandson using Geometrica

Bruno Autin
bautin1@club-internet.fr

This is holiday time and my grandson, Jos, is curious about Geometrica. I explain a few things, and we agree to survey special lines called perpendicular bisectors or, more usually, bisectors in a triangle. First, we learn how to call Geometrica, then to draw a triangle and determine step by step the bisectors of the triangle. We finish with the circumcircle of a triangle. The naive questions asked by my grandson shed light on the basic concepts of both Mathematica and Geometrica.

Calling Geometrica

<< Geometrica`Geometrica05`

Jos: I trust you, but this is a strange way of using a program.
Bruno: In Mathematica, there is a syntax as in any language: English, French, Spanish, Chinese, ... The sign "<<" means "Call". What you call is the program "Geometrica05" located in the folder Geometrica.

Manipulating a Triangle

Bruno: We want to draw a triangle that has no special property. The function to do that is Triangle[] and we give the name t to that triangle.

t = Triangle[]

Jos: I understand Triangle but why the brackets after it?
Bruno: In Mathematica, any statement is made of an operator that acts on variables enclosed in a pair of brackets. Here, the operator is Triangle. The variables of Triangle are the three vertices. In our case, they are hidden, we call them default variables. You can see what they actually are in the result returned by Geometrica. They are the three points of general form CPoint[x,y], where x and y are the coordinates of the point.
Jos: What are the coordinates of a point?
Bruno: To know where a point is in the plane, one defines a reference system made of two perpendicular axes x and y that intersect at the origin 0. The coordinates of a point are the abscissa and the ordinate. The abscissa is the distance of the point to the y-axis and the ordinate the distance to the x-axis.
Jos: I do not see the point of all that complication. At school, we define a triangle by three points. I put the points somewhere on a page of a notebook and I join them by lines. Nothing more.
Bruno: OK, this is the way Greeks dealt with geometry. When one works with a computer, we have to define a mechanism that the computer can understand. That mechanism is the analytic geometry invented by Pierre de Fermat and René Descartes in the seventeenth century.  But I go too far. You will learn that in more detail later on. Now, I shall type a semi-colon at the end of each statement, the result will not appear and we shall draw all we need. We continue?
Jos: No, there is still something bizarre. You defined a triangle and I see Segment in the result.
Bruno: If you give me two points and ask me to join them by a piece of straight line, I draw a segment. True?
Jos: Yes.
Bruno: If you give me three, four, five points, I shall draw a triangle, a quadrangle, a pentagon. And I can continue with as many points as you like. The operation is always the same. It consists of joining points with segments of straight lines. The figures so obtained belong to the family of the polygonal lines. I had to choose a name for the family, it could have been PolygonalLine but it was long and not well-adapted for two points. I preferred to take the most elementary one, the segment.
Jos: Fine. Go ahead now and draw me figures.
Bruno: The simplest thing to do is to draw the triangle t with the function Draw.

Draw[t];

Jos: Not bad, but a bit dry. A triangle, I am used to calling it ABC.
Bruno: For that, you have to add the function Legend to the arguments of Draw. The variables are then the text you want to write, say "ABC," and the object to which you apply the legend, here the triangle t.

Draw[t, Legend["ABC", t]];

Jos: And some color?
Bruno: Easy. You add the color in Draw. Do it yourself.

Draw[blue, t, Legend["ABC", t]];

Bruno: All Mathematica names start with a capital letter.
Jos: But t is not a capital letter.
Bruno: t was defined by us, it does not belong to the catalog of Mathematica names. Redo the drawing.

Draw[Blue, t, Legend["ABC", t]];

Jos: The letters stay black.
Bruno: Yes, because the color affects only graphical objects and the legend is just text. You can also paint the triangle.

Draw[Paint[t, Blue], Legend["ABC", t]];

Jos: Cool!

Bisectors

Bruno: You remember what bisectors are?
Jos: There are bisectors for segments and for ... angles.
Bruno: Dealing with angles is quite possible with Geometrica, but the definition of angles is somewhat involved and that would take us too far. Let us limit ourselves to the bisector of a segment that is perpendicular to the midpoint of a segment. The segments that we use are the sides of the triangle.
Jos: I will guess how to find them.

Sides[t]

Bruno: Bravo. How many sides did you find?
Jos: Three.
Bruno: For a start, I would like you to work with one side only, say the first one.
Jos: How can I select it among the three?
Bruno: The result you got is a list. The three sides are inside a pair of curly brackets. Remember these basic notations: a pair of square brackets for variables of a function and a pair of curly brackets for a list of objects. A neat thing to do is to define the sides by a list of three objects also. The first, second and third object of the left-hand list will be the name of the first, second and third side of the right-hand list. Let me do it for you.

{s1, s2, s3} = Sides[t]

Jos: I would like to see what they are.
Bruno: Draw them in different colors.
Jos: I will try.

Draw[Red, s1, Green, s2, Blue, s3];

Attaching a Point to a Segment

Bruno: You have become an expert! Now, we shall learn how to place a point on a segment. There is a general function called Pointer to attach a point to an object. Here the object is the segment (Subscript[s, 1]). The position of the point on a segment AB is defined by a variable called a parameter. If the point is in A, the parameter is 0. If the point is in B, the parameter is 1. Can you guess the value of the parameter for the midpoint?
Jos: 0.5.
Bruno: Right or (1/2). If you use 0.5, all the results will be given with decimal points. If you take (1/2), the results will be exact. As our problem is simple, it is better to take (1/2).

m = Pointer[s1, 1/2]

Jos: Let me check.

Draw[m, Red, s1];

First Construct

Bruno: Now, we have to find the perpendicular to the segment (Subscript[s, 1]) at m.
Jos: I know, one takes a compass, places the center at one end of the segment and draws an arc of circle around the midpoint. One does the same thing at the other end, and we join the intersections of the two arcs.
Bruno: I will give you the tool. It is the function ECircle, its variables are the center of the circle and the radius. You will ask me why ECircle and not simply Circle. This is because Circle is already a Mathematica function that denotes a graphical object, whereas ECircle is a geometric object that you can draw, transform, intersect, etc. The E reminds us that it is a Euclidean definition, from the name of the Greek geometer Euclid.
Jos: I think I can do it. Let me try.

{c1, c2} = {ECircle[]}

Jos: But I do not have the ends of (Subscript[s, 1])...
Bruno: You will learn a great feature of Mathematica: changing the head of an object. It is very natural to change the variables of a function. The name variable indicates that they may take any value. It is more surprising to keep the variables fixed and change the name of the function. To get the ends of (Subscript[s, 1]), it would be ideal to replace the head Segment by the head List. This is actually feasible using the notation @@. Let me show you.

{a, b} = List @@ s1

Jos: It works, but I do not see the word List.
Bruno: It is a matter of notation. The result in the form of curly brackets is interpreted by Mathematica as List[a, b].
Jos: I believe you. Let me continue my construction now.

{c1, c2} = {ECircle[a,]}

Jos: Ah, but what do I take for the radius?
Bruno: Evaluate the distance from a to b.

d = Distance[a, b]

Jos: I should be able to do it now.

{c1, c2} = {ECircle[a, 3  d/4], ECircle[b, 3  d/4]};
Draw[s1, Blue, c1, c2];

Jos: How to find the intersections of the two circles?
Bruno: With the function Intersections.
Jos: Like that?

{p, q} = Intersections[c1, c2]

Jos: And to join pq by a straight line?
Bruno: Use ELine.
Jos: Always Euclid!

bi = ELine[p, q];
Draw[s1, Blue, c1, c2, Red, bi];

Second Construct

Bruno: You are very good.
Jos: It's fun, and I did not use the point m.
Bruno: True. It would have been useful if you had drawn the bisector as the line perpendicular to (Subscript[s, 1]) in m. Still with ELine.

bi1 = ELine[s1, m]

Jos: I found a bug in your program!
Bruno: You used ELine before with two points. You reused it with a segment and a point. This form is not recognized by Geometrica. Let us look at what Geometrica offers to you.

?ELine

Bruno: The next statement should work.

d1 = ELine[a, b];
bi1 = ELine[m, d1]
Draw[s1, m, Red, bi1];

Jos: I am not convinced that bi and (Subscript[bi, 1])are the same.
Bruno: You could draw them and observe that they are superimposed, but this is not easy. Better use the function IdenticalQ.

IdenticalQ[bi, bi1]

Quick Construct

Bruno: A program is written not only to emulate what you learn at school but also to work quickly. Therefore, you can get the bisector of a segment without performing a detailed construction.
Jos: With Bisector and a segment?
Bruno: Yes.

Bisector[s1]

Jos: And for a triangle?
Bruno: And for any polygonal line, remember that the family of the polygonal lines was called Segment in Geometrica.

Bisector[t]

Jos: Cool. Let me draw everything. I will give a name to the three bisectors first.

bt = Bisector[t];
Draw[Legend["ABC", t], Paint[t, Red], Blue, bt];

Jos: The bisectors are too big.
Bruno: You see, a line goes to infinity. If you do not say anything, the parameter of the line extends from -π to π. 
Jos: What is the parameter of a line?
Bruno: It looks like the parameter of a segment. It is a number that gives the position of a point on the line. To reduce the length of the line on the figure, we can limit the range of variations of the parameter to (-1, 1) using DrawRange. I will show you.

Draw[Legend["ABC", t], Paint[t, Red], DrawRange[-1, 1], Blue, 
        bt];

Circumcircle

Jos: Is it true that they pass all by the same point?
Bruno: Yes. Geometrica can tell you that the conjecture is true. You intersect two bisectors ... 
Jos: OK, I know.

{b1, b2, b3} = bt;
x = Intersections[b1, b2]

Bruno: The result is not pretty, try to simplify it using Simplify.

Simplify[x]

Jos: Bingo!
Bruno: And now you can check that x belongs to the third bisector using OfQ.

OfQ[x, b3]

Jos: Our teacher asks us for more than true or false. He wants a proof.
Bruno: Geometrica has an internal procedure of validation based on a solution of equations. It does not give you the sequence of statements that makes a proof, but isn't it better to leave you the privilege of reasoning?
Jos: You mean that, even with Geometrica, I shall still have to do my homework?
Bruno: Yes. Let me show you one last thing. This point, common to the bisectors, is the center of the circle circumscribed to the triangle.
Jos: I will do that and we will stop because I am a bit tired with Euclid, parameters, coordinates and all that stuff. What are the functions?
Bruno: Circumcenter and Circumcircle.

cce = Circumcenter[t];
cci = Circumcircle[t];
Draw[Legend["ABC", t], Paint[t, Red], DrawRange[-1, 1], Blue, 
        bt, Green, cce, cci];

Jos: Pretty, pretty, pretty! Thank you Granddad. Come and play ping pong.