geogebra workshop - facultyfp.salisbury.edu · geogebra is dynamic mathematics software that joins...

72
GeoGebra Workshop Don Spickler Department of Mathematics and Computer Science Salisbury University

Upload: others

Post on 16-Mar-2020

4 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: GeoGebra Workshop - facultyfp.salisbury.edu · GeoGebra is dynamic mathematics software that joins geometry, algebra and calculus. It is developed for learning and teaching mathematics

GeoGebra Workshop

Don Spickler Department of Mathematics and Computer Science

Salisbury University

Page 2: GeoGebra Workshop - facultyfp.salisbury.edu · GeoGebra is dynamic mathematics software that joins geometry, algebra and calculus. It is developed for learning and teaching mathematics

GeoGebra Workshop

1

Contents Introduction ..................................................................................................................................... 3

What is GeoGebra? ..................................................................................................................... 3

Get GeoGebra ............................................................................................................................. 3

Workshop Sections ..................................................................................................................... 3

Workshop Format ....................................................................................................................... 4

Geometry......................................................................................................................................... 5

GeoGebra Features...................................................................................................................... 5

GeoGebra Layout ........................................................................................................................ 5

Euclid I.1 ..................................................................................................................................... 8

The Centroid ............................................................................................................................. 11

The Incenter and Incircle .......................................................................................................... 14

The Orthocenter ........................................................................................................................ 17

The Circumcenter and Circumcircle ......................................................................................... 17

The Euler Line .......................................................................................................................... 17

The 9 Point Circle ..................................................................................................................... 18

Algebra & Trigonometry .............................................................................................................. 19

GeoGebra Features.................................................................................................................... 19

Curve Fitting ............................................................................................................................. 20

Multiplicity Experiment ............................................................................................................ 24

The Sine Function Family ......................................................................................................... 26

The Sine Function: Circle to Function ...................................................................................... 28

The Cosine Function: Circle to Function .................................................................................. 30

Exponential and Logarithmic Family Experiment .................................................................... 32

Logistic Function Family .......................................................................................................... 32

Logistic Function Curve Fitting ................................................................................................ 33

Calculus......................................................................................................................................... 35

GeoGebra Features.................................................................................................................... 35

Graphing the Derivative Using the Slope: Example 1 .............................................................. 37

Graphing the Derivative Using the Slope: Example 2 .............................................................. 40

Graphing the Derivative Using the Slope: Example 3 .............................................................. 41

Optimization Example .............................................................................................................. 43

Lower and Upper Riemann Sums ............................................................................................. 45

Page 3: GeoGebra Workshop - facultyfp.salisbury.edu · GeoGebra is dynamic mathematics software that joins geometry, algebra and calculus. It is developed for learning and teaching mathematics

GeoGebra Workshop

2

Left and Right Riemann Sums .................................................................................................. 46

Net Area Exploration ................................................................................................................ 50

More Features & Examples .......................................................................................................... 52

GeoGebra Features.................................................................................................................... 52

Web Diagrams .......................................................................................................................... 54

One Parameter Family Iterates .................................................................................................. 56

Generalized Parabolas ............................................................................................................... 57

Another Optimization Example ................................................................................................ 59

Yet Another Optimization Example ......................................................................................... 61

Making Applets from your Sketches ........................................................................................ 62

User Interaction with Applets ................................................................................................... 64

User Defined Tools ................................................................................................................... 69

Page 4: GeoGebra Workshop - facultyfp.salisbury.edu · GeoGebra is dynamic mathematics software that joins geometry, algebra and calculus. It is developed for learning and teaching mathematics

GeoGebra Workshop

3

Introduction

What is GeoGebra?

GeoGebra is dynamic mathematics software that joins geometry, algebra and calculus. It is developed for learning and teaching mathematics in schools by Markus Hohenwarter and an international team of programmers. As one reviewer put it, "Think of it as a free Geometer's Sketchpad, just twin-turbocharged and on steroids..."

GeoGebra is much like Geometer's Sketchpad (GSP) but as with any two software packages that do similar things there are going to be some things that one does better than the other and vice-versa. In my opinion geometry and geometric measurements is much easier in GSP but if you want to move to other classes, like Calculus, GeoGebra is far better.

One of the biggest differences between GeoGebra and GSP is the base philosophy of their use. GSP was designed to emulate straightedge and compass constructions/ Now GSP does not restrict itself to purely straightedge and compass constructions but it is very close. This is the primary reason that GSP has so few tools in comparison to GeoGebra. GeoGebra does not restrict itself to straightedge and compass constructions in the least. In fact, GeoGebra has many features that are not constructions. The base philosophy with GeoGebra is to present the user with a large set of visualization features.

Get GeoGebra

GeoGebra is a free multiplatform Java application; moreover, there are several ways that it can be installed. You can install it like any other program, run it through either Java WebStart or as an applet or in a portable format that can be run directly off of a network drive or thumb drive. The software can be downloaded from the GeoGebra web site (www.geogebra.org). The GeoGebra web site also contains documentation, workshop materials, and user forum. http://www.geogebra.org/cms/

Workshop Sections

Geometry This section contains an introduction to some of the features GeoGebra has for Geometry. We also discuss the basic setup and tools of GeoGebra. Even if you are more interested in the Precalculus and Calculus applications it is recommended that you go through this section to get a feel of how GeoGebra works.

Page 5: GeoGebra Workshop - facultyfp.salisbury.edu · GeoGebra is dynamic mathematics software that joins geometry, algebra and calculus. It is developed for learning and teaching mathematics

GeoGebra Workshop

4

Algebra & Trigonometry This section contains an introduction to some of the features GeoGebra has for Algebra & Trigonometry. We also discuss sliders, inserting text, and plotting data points through the spreadsheet view. Calculus This section contains an introduction to some of the features GeoGebra has for Calculus I and II. We also discuss more advanced calculation features of GeoGebra.

More Features & Examples This section deals with more difficult manipulations and exporting GeoGebra sketches to HTML. We also discuss tool creation, tool management and some other tools that have not been discussed in the other sections.

Workshop Format

This document was constructed from the online GeoGebra workshop that is on my web site. Instead of going through all of the features of the GeoGebra program I decided to make this workshop example oriented. The online version has applets for all example constructions so that you can change the sketch dynamically to see how it works, with this printed version all we can do is include graphical images of the applets. The online version also has a resources page of links and documentation on the GeoGebra tools and menu options as well as GeoGebra files for each of the constructions in the workshop.

Page 6: GeoGebra Workshop - facultyfp.salisbury.edu · GeoGebra is dynamic mathematics software that joins geometry, algebra and calculus. It is developed for learning and teaching mathematics

GeoGebra Workshop

5

Geometry

GeoGebra Features

In this series of examples we will concentrate on the layout of GeoGebra, the basics of dynamic geometry, simple construction tools, and the construction protocol.

GeoGebra Layout

When you start up GeoGebra you should see something like the image below.

There are four main sections to the GeoGebra window.

1. The Menu and Toolbar - These are at the top, as usual. The toolbar is customizable by selecting Tools > Customize Toolbar... from the main menu. This allows you to restrict the student to use only the tools you want them to. For example, you could remove all tools except for the straightedge and compass tools if you are beginning a study of Euclidean Geometry.

2. The Algebra View - This window on the left. The Algebra View is a tree list of all objects in the current construction. You can alter the properties of any object in the construction using this list.

3. The Graphics View - This is the main window on the right. This where the construction can be viewed and manipulated.

Page 7: GeoGebra Workshop - facultyfp.salisbury.edu · GeoGebra is dynamic mathematics software that joins geometry, algebra and calculus. It is developed for learning and teaching mathematics

GeoGebra Workshop

6

4. The Input Bar - The input bar is at the bottom of the GeoGebra window. The Input Bar is where the user can add objects and calculations that are beyond the capabilities of the tools.

There is also a spreadsheet view in the GeoGebra program. We will look at this later in the workshop. When viewed it appears to the right of the Graphics View.

All views, except for the graphics view can be turned off or on using the View option in the main menu. You will also note that the tools in the toolbar have small triangles pointing down in the lower right of the icon. If you click on this triangle a drop-down menu will appear with other tools that are related to the one you clicked. The toolbar also contain two icons to the right for undo and redo. Furthermore, there are tool hints between the tools and the undo/redo icons. These hints give you quick instructions on how to use the tool that is currently selected.

The View option in the main menu also allows you turn the axes and grid off and on. GeoGebra has pop-up menus for all of its objects. If you want to change any of the properties of an object simple right-click on that object either in the Algebra View or the Geometry View and a pop-up menu will appear for that object.

Page 8: GeoGebra Workshop - facultyfp.salisbury.edu · GeoGebra is dynamic mathematics software that joins geometry, algebra and calculus. It is developed for learning and teaching mathematics

GeoGebra Workshop

7

If you are familiar with GSP then the use of the GeoGebra program should be fairly natural to you. The big difference is that the general process is reversed. In GSP you usually select one or more objects and then select what you want to do with them, in GeoGebra this is reversed and you select what you want to do and then select the objects. For example, if you want to create a line that goes through a point and perpendicular to a given line in GSP you would select the point and line first and then tell the program to construct a perpendicular. In GeoGebra you would select the perpendicular tool and then select the line and point.

Page 9: GeoGebra Workshop - facultyfp.salisbury.edu · GeoGebra is dynamic mathematics software that joins geometry, algebra and calculus. It is developed for learning and teaching mathematics

GeoGebra Workshop

8

Euclid I.1

Euclid I.1 is the construction of an equilateral triangle. Recall that the construction goes like this.

1. We are given, or we construct a finite line segment AB. 2. Construct a circle with center A and radius AB. 3. Construct a circle with center B and radius BA. 4. Take one of the two points of intersection of the two circles and call it C. 5. Construct the segments AC and BC.

As you would expect, the construction in GeoGebra is exactly the same. We will also be detailed on which tools to select and when.

1. Start up GeoGebra or select File > New Window... from the main menu. 2. We will not need the axes so right-click on the Graphics View and deselect the Axes

option. 3. Click the little down arrow on the line icon and select the Segment between Two Points

tool. 4. Click and release on the Graphics View. This will create the point A and attach a line

segment between A and the cursor. Now move the mouse to another area of the Graphics View and click again. This will create the point B and the segment AB.

5. Select the circle tool, which is Circle with Center through Point. 6. Move the cursor over the point A. Notice that when the arrow is pointing at A the point

highlights. Also notice in the Algebra View the point A highlights as well. 7. Click on A, move the cursor over to B and click on B. At this point you should have a

circle with center A and radius AB. 8. Now is a good time to do a drag-test. Periodically in the construction of a sketch you

want to select the move tool (the Arrow on the far left) and click and drag some of the points around. The rest of the sketch should change dynamically and the objects should stay linked together. If they don't then you know that you need to back up and redo something.

9. Click on B, move the cursor over to A and click on A. At this point you should have a circle with center B and radius BA.

10. Select the point tool (actually the New Point tool). 11. Move the cursor over the point of intersection between the two circles. You should see

both circles highlight at the same time. Click on the point of intersection. This should create the point C on the intersection. Do a drag-test. While we are here, note the color of the point C and points A and B. Points A and B should be blue and point C should be black. This is telling you that the points A and B are free points that are movable and point C is dependent on other objects (i.e. the circles) and not freely movable.

12. Select the line segment tool. 13. Create a line segment from A to C by clicking on A, moving to C and clicking on C. 14. Create a line segment from B to C by clicking on B, moving to C and clicking on C. 15. At this point your sketch should look something like this,

Page 10: GeoGebra Workshop - facultyfp.salisbury.edu · GeoGebra is dynamic mathematics software that joins geometry, algebra and calculus. It is developed for learning and teaching mathematics

GeoGebra Workshop

9

Now we should clean things up a bit. We don't need to see the circles in the construction nor do we need the line names (lowercase letters). First we will hide the circles. Notice that we are hiding the circles not deleting them. As with GSP if you delete an object any dependent objects will also be removed. So if we delete a circle we will also delete point C and hence the line segments connected to C.

16. There are a couple ways to hide an object. One is to right-click on the object and deselect the Show Object option in the pop-up menu. The other is to click on the bullet to the left of the object description in the Algebra View window. Use either method to hide the two circles.

17. To turn off the lowercase line labels you can either right-click on the object and deselect the Show Label option or right-click on the object description in the Algebra View and deselect the Show Label option. Do that for the three line segments.

18. At this point your sketch should look something like the following. Do a drag-test and save your sketch.

Page 11: GeoGebra Workshop - facultyfp.salisbury.edu · GeoGebra is dynamic mathematics software that joins geometry, algebra and calculus. It is developed for learning and teaching mathematics

GeoGebra Workshop

10

The way GeoGebra hides and shows objects is much nicer than GSP. In GSP you hide an object by right-clicking on it and selecting the hide option from the pop-up menu, just like GeoGebra. But when you want to show an object in GSP your only option is to show all of the hidden objects and then you need to rehide the ones you want hidden. In GeoGebra, to show a single object you need only click on the bullet beside the object in the Algebra View.

Below is an applet with the sketch you just created. These applets are automatically constructed with GeoGebra, no programming needed. We will discuss how to do them later in the workshop.

Page 12: GeoGebra Workshop - facultyfp.salisbury.edu · GeoGebra is dynamic mathematics software that joins geometry, algebra and calculus. It is developed for learning and teaching mathematics

GeoGebra Workshop

11

The Centroid

Definition: The segment joining a vertex of a triangle to the midpoint of the opposite side is called a median for the triangle.

Median Concurrence Theorem: The three medians of any triangle are concurrent; that is, if ABC is a triangle and D, E, and F are the midpoints of the sides opposite A, B, and C, respectively, then AD, BE, and CF all intersect in a common point G. Moreover, AG = 2GD, BG = 2GE, and CG = 2GF.

Definition: The point of concurrency of the three medians is called the centroid of the triangle. The centroid is usually denoted by G.

The construction of the centroid is fairly simple. Recall that the construction goes like this.

1. Construct a triangle. 2. Construct the midpoints to each of the sides of the triangle. 3. Construct line segments from each midpoint to the opposite vertex. 4. Construct the intersection point of these line segments.

Now another part of the theorem is a measurement relationship between segment lengths. So we will add in some measurements too.

1. Start a new sketch and hide the axes. 2. Select the line segment tool and create a triangle. 3. Do a drag-test. 4. Select the Midpoint or Center tool. This is one of the options under the point tool on the

left. One big difference between GSP and GeoGebra is that when you construct something in GSP you select the objects first and then go to the menu to do the construction but in GeoGebra you select the type of construction first and then select the objects.

5. Click on each of the three sides of the triangle and you should see three midpoints appear on the sketch.

6. Select the line segment tool and connect each midpoint to the opposite vertex. 7. Do a drag-test. The three medians should intersect in a single point.

Page 13: GeoGebra Workshop - facultyfp.salisbury.edu · GeoGebra is dynamic mathematics software that joins geometry, algebra and calculus. It is developed for learning and teaching mathematics

GeoGebra Workshop

12

8. To plot the point of intersection we could select the New Point tool and place our cursor on the intersection point and click. There is one problem with this, note that when you place the cursor over the intersection point all three medians highlight. Since we can only plot the intersection of two lines GeoGebra does not know which two to use. There is an alternative way to get this intersection point. Select the Intersect Two Objects tool, this is one of the options under the point tool on the left. Now click on one median and then another median.

9. Do a drag-test. 10. At this point your sketch should look like the following. If you want, you can remove the

labels on the lines.

11. So the geometry is done and it is time to do some measuring. Just like constructions in GeoGebra, the easy measurements can be done by selecting the right tool and then the objects. More complicated calculations are done through the Input bar at the bottom of the window.

Select the Distance or Length measurement tool and then click on the midpoint and then the centroid. At this point you should see a new label on the sketch with the measurement. Now click on the corresponding vertex and then the centroid. This will give you one set of measurements in the theorem.

12. Repeat the measurement calculations for each of the other two medians. 13. Do a drag-test. 14. Note that when you do the drag-test the measurement is locked to the sketch. You can

move the measurement around but it will stay within a circle close to the position of the thing it is measuring. If you want to move the measurement to another place in the sketch simply right-click on the measurement and select Absolute Position on Screen. At this point you can move the measurement freely around the screen. Along the same lines, if

Page 14: GeoGebra Workshop - facultyfp.salisbury.edu · GeoGebra is dynamic mathematics software that joins geometry, algebra and calculus. It is developed for learning and teaching mathematics

GeoGebra Workshop

13

you want to lock the measurement to the sketch right-click and select Fix Object. If you want to see more decimal places in the measurement, select Options > Rounding >... and then the number of places to display.

Page 15: GeoGebra Workshop - facultyfp.salisbury.edu · GeoGebra is dynamic mathematics software that joins geometry, algebra and calculus. It is developed for learning and teaching mathematics

GeoGebra Workshop

14

The Incenter and Incircle

Angle Bisector Concurrence Theorem: If ABC is any triangle, the three bisectors of the interior angles of ABC are concurrent. The point of concurrency is equidistant from the sides of the triangle.

Definition: The point of concurrency of the bisectors is called the incenter of the triangle. The distance from the incenter to sides of the triangle is the inradius. The circle that has its center at the incenter and is tangent to each of the sides of the triangle is called the inscribed circle, or simply the incircle of the triangle.

The construction of the incenter and incircle is fairly simple.

1. Construct a triangle. 2. Construct the angle bisectors of each of the interior angles. These bisectors will intersect

in a single point, the incenter. 3. Construct the intersection point of these lines. 4. Drop a perpendicular from the incenter to any side. This gives a radius. 5. Construct the point of intersection between the side and perpendicular. 6. Construct a circle that has center of the incenter and the intersection point on the circle

itself. This is the incircle.

The GeoGebra construction follows the same pattern.

1. Start a new sketch and hide the axes. 2. Select the line segment tool and create a triangle. 3. Do a drag-test. 4. Select the Angle Bisector tool. This is one of the options under the Perpendicular Line

tool. One big difference between GSP and GeoGebra is that when you construct something in GSP you select the objects first and then go to the menu to do the construction but in GeoGebra you select the type of construction first and then select the objects.

5. Click on all three vertices of the triangle, one at a time. You will see that an angle bisector is created at the vertex of the second point clicked.

Page 16: GeoGebra Workshop - facultyfp.salisbury.edu · GeoGebra is dynamic mathematics software that joins geometry, algebra and calculus. It is developed for learning and teaching mathematics

GeoGebra Workshop

15

6. Repeat for the other two angles. 7. Select the Perpendicular Line tool and construct a perpendicular to one side passing

through the incenter. 8. Construct the point of intersection of the perpendicular and the side. 9. Select the circle tool and construct a circle that has center of the incenter and the

intersection point on the circle itself. 10. Do a drag-test. 11. Clean up the sketch.

Another neat feature of GeoGebra is the construction step interface. There are two ways to view how the constructions were done. First you can select View > Construction Protocol... from the main menu. When you do you will get the following dialog box displaying each step in the construction. If you click on the controls at the bottom the graphics view will display the construction from the first step to the position of the highlighted line.

The second way is to select View > Navigation Bar for Construction Steps from the main menu. This will place the step selector at the bottom of the graphics view window. Again clicking on the controls moves you through the construction steps. GeoGebra also has an automatic construction animation feature.

Page 17: GeoGebra Workshop - facultyfp.salisbury.edu · GeoGebra is dynamic mathematics software that joins geometry, algebra and calculus. It is developed for learning and teaching mathematics

GeoGebra Workshop

16

Page 18: GeoGebra Workshop - facultyfp.salisbury.edu · GeoGebra is dynamic mathematics software that joins geometry, algebra and calculus. It is developed for learning and teaching mathematics

GeoGebra Workshop

17

The Orthocenter

Altitude Concurrence Theorem: The three altitudes of any triangle are concurrent.

Definition: The point of concurrency of the three altitudes is called the orthocenter of the triangle. It is usually denoted by H.

Exercise: Construct a general triangle and its orthocenter. As in the sketch below.

The Circumcenter and Circumcircle

Altitude Concurrence Theorem: The three altitudes of any triangle are concurrent.

Definition: The point of concurrency of the three perpendicular bisectors of the sides of a triangle is called the circumcenter of the triangle. The circumcenter is usually denoted by O. The circle with the center of a triangle's circumcenter and passes through all three vertices is called the circumcircle of the triangle.

Exercise: Construct a general triangle, its circumcenter and its circumcircle. As in the sketch below.

The Euler Line

Euler Line Theorem: The orthocenter H, the circumcenter O, and the centroid G of any triangle are collinear. Furthermore, G is between H and O (unless the triangle is equilateral, in which case the three points coincide) and HG = 2GO.

Definition: The line through H, O, and G is called the Euler line of the triangle.

Exercise: Construct a general triangle, its orthocenter H, circumcenter O, and centroid G. Also construct its Euler Line and measurements to show that HG = 2GO. As in the sketch below.

Page 19: GeoGebra Workshop - facultyfp.salisbury.edu · GeoGebra is dynamic mathematics software that joins geometry, algebra and calculus. It is developed for learning and teaching mathematics

GeoGebra Workshop

18

The 9 Point Circle

The 9 point circle is frankly just nifty. Take any triangle, plot the midpoints of the sides, plot the feet of the altitudes, and finally plot the midpoints between the vertices and the orthocenter. The 9 points you just plotted all lie on the same circle.

Exercise: Construct a general triangle and its 9 point circle. As in the sketch below.

Page 20: GeoGebra Workshop - facultyfp.salisbury.edu · GeoGebra is dynamic mathematics software that joins geometry, algebra and calculus. It is developed for learning and teaching mathematics

GeoGebra Workshop

Algebra & Trigonometry

GeoGebra Features

In this series of examples we will concentrate on sliders, basic input, the spreadsheet view, point tracing and locus.

Sliders are tools that assign values to a variable dynamically by moving a point along a line segment. In GSP you create a slider by creating a line segment, placing a point on that segment, and then doing a calculation of the ratio the point is along the segment so that the calculation has your desired starting and ending values. In GeoGebra this is all built in. When you create a slider you will have the option to set the minimum and maximum values as well as the increment and other options. In GeoGebrawhich can be used in defining other objects, hence linking the object to the slider.

The input bar at the bottom of the window is for inputting objects and calculations that are too complicated to be done by the tools. We will look at only some simple input in these examples but in general this feature can be very powerful.

The Spreadsheet view is like the algebra and graphic views except that it provides a spreadsheet layout and standard spreadsheet functionality that is linked to the rest of the program. So you can use values from sliders and the algebra view in the cell calculations.

Point tracing is simple and is similar to that of GSP. You simply turn point tracing on and when the point is moved it will leave a trail. Locus is like point tracing except that it does the tracing without the need to move another object. The way a locus is set up is that you select a driver object and a driven object (in that order). The program will move the driver object uconfined to a line or circle) and trace out the path of the driven object.

19

Algebra & Trigonometry

In this series of examples we will concentrate on sliders, basic input, the spreadsheet view, point

Sliders are tools that assign values to a variable dynamically by moving a point along a line segment. In GSP you create a slider by creating a line segment, placing a point on that segment, and then doing a calculation of the ratio the

e segment so that the calculation has your desired starting and ending values. In GeoGebra this is all built in. When you create a slider you will have the option to set the minimum and maximum values as well as the increment and other options. In GeoGebra a slider is associated with a variable name which can be used in defining other objects, hence linking the object to the slider.

The input bar at the bottom of the window is for inputting objects and calculations that are too

he tools. We will look at only some simple input in these examples but in general this feature can be very

The Spreadsheet view is like the algebra and graphic views except that it provides a spreadsheet layout and standard spreadsheet

lity that is linked to the rest of the program. So you can use values from sliders and the algebra view in the cell calculations.

Point tracing is simple and is similar to that of GSP. You simply turn point tracing on and

leave a trail. Locus is like point tracing except that it does the tracing without the need to move another object. The way a locus is set up is that you select a driver object and a driven object (in that order). The program will move the driver object under any constraints it has (like being confined to a line or circle) and trace out the path of the driven object.

In this series of examples we will concentrate on sliders, basic input, the spreadsheet view, point

a slider is associated with a variable name which can be used in defining other objects, hence linking the object to the slider.

lity that is linked to the rest of the program. So you can use values from sliders and the

nder any constraints it has (like being

Page 21: GeoGebra Workshop - facultyfp.salisbury.edu · GeoGebra is dynamic mathematics software that joins geometry, algebra and calculus. It is developed for learning and teaching mathematics

GeoGebra Workshop

20

Curve Fitting

This construction is a simple setup for your students to do some experimental curve fitting. We will be taking data that was generated form a quadratic and setting up a general quadratic with sliders that will allow the student to play with the coefficients of the quadratic to find the one that passes through the data points.

1. Start a new sketch. 2. Select the slider tool in the right side of the toolbar. 3. Click on the graphics view. When you do the slider dialog will appear. This dialog allows

you to set the minimum and maximum values for the slider as well as the increment for the slider.

If you click on the Slider tab you will see a few other options. This tab allows you to select the orientation of the slider as well as the length of the slider in pixels. The fixed option will lock its position in the graphics view, if this is not selected the Move tool can move it freely around the window.

4. Change the Increment to 0.01 and the Width to 300, then select Apply and you should have a slider on the screen with the label a.

5. Do this two more times to get sliders b and c. 6. Move the sliders to a convenient position on the screen. 7. To input a function in GeoGebra we use the Input Bar at the bottom. The input bar, in

general, is used for inputting commands that are more difficult than simple constructions. Although this requires the user to learn some syntax the functionality trade-off is worth it. Type the following into the input box and hit enter.

Page 22: GeoGebra Workshop - facultyfp.salisbury.edu · GeoGebra is dynamic mathematics software that joins geometry, algebra and calculus. It is developed for learning and teaching mathematics

GeoGebra Workshop

21

f(x) = a x^2 + b x +c

Note that there must be a space between the a and x^2 as well as the b and x. At this point you should see the graph of the function and when you move the sliders you should see the graph change dynamically.

8. We will add one more thing to our sketch, a function label. This will require the Insert Text tool which is under the slider tool. Select this tool and click on the graphics window. This will bring up the text tool dialog.

Input

"f(x) = " + f

and select OK. The text in "" will be displayed verbatim, the + is a string concatenation and the last f will be substituted with the current value of the function, it will be dependent on a, b, and c. If you move the sliders at this point not only will the graph change but so will the displayed function label.

9. Now we need to put in the data. Select View > Spreadsheet View from the main menu. At this point a spreadsheet layout will appear to the right of the graphics view.

10. If you were doing the on-line version of this workshop you could click on the provided link to get the set of data points and copy them into the spreadsheet view. In this case you will need to input them yourself.

-2 0 -0.35 1.07 -1.85 -0.13 -0.2 1.44 -1.7 -0.21 -0.05 1.85 -1.55 -0.25 0.1 2.31 -1.4 -0.24 0.25 2.81 -1.25 -0.19 0.4 3.36 -1.1 -0.09 0.55 3.95 -0.95 0.05 0.7 4.59 -0.8 0.24 0.85 5.27 -0.65 0.47 1 6 -0.5 0.75

Page 23: GeoGebra Workshop - facultyfp.salisbury.edu · GeoGebra is dynamic mathematics software that joins geometry, algebra and calculus. It is developed for learning and teaching mathematics

GeoGebra Workshop

22

11. Select all of the data in the spreadsheet view, right-click on the data and select Create List of Points. At this point you will see a set of points in a parabolic pattern.

12. The only downside here is that these points are free points, which means that they can be moved by the mouse. Since we do not want that to happen we will make them fixed points. We also do not need to have labels on all the points so we will remove them. We could do all of this from the graphics view but let's look at another feature of GeoGebra. Hit Control-E, this will bring up the object properties dialog box that will let you change any of the properties on any of the objects. On the left you will see a tree view of all of the objects you have in your sketch. One entry should be Point. Click on the + to the left of Point and you should see all of the point names in your sketch. Click on the name Point so that it is highlighted and your dialog should look something like the following.

Check Fix Object and uncheck Show Label and then click the close button. Now your graphics view should look like the applet below. At this point you can close the spreadsheet view.

Page 24: GeoGebra Workshop - facultyfp.salisbury.edu · GeoGebra is dynamic mathematics software that joins geometry, algebra and calculus. It is developed for learning and teaching mathematics

GeoGebra Workshop

23

One thing I like to do to students who are just starting out with curve fitting is to have them fight with the set up above for a while and then make the following change. In the input bar type the following command and hit enter.

f(x) = a (x - b)^2 + c This, of course, changes the way that a, b and c act. Have them work with fitting the curve using this form. Most find it much easier and obtain the solution far quicker. Another feature of the GeoGebra sliders is that if you click on a slider you can use the arrow keys to alter their values.

Page 25: GeoGebra Workshop - facultyfp.salisbury.edu · GeoGebra is dynamic mathematics software that joins geometry, algebra and calculus. It is developed for learning and teaching mathematics

GeoGebra Workshop

24

Multiplicity Experiment

This construction is a simple experiment to show the difference between even and odd multiplicities and how the graph is shaped at the root.

1. Start a new sketch. 2. Select the slider tool in the right side of the toolbar. 3. Click on the graphics view. When you do the slider dialog will appear. This dialog allows

you to set the minimum and maximum values for the slider as well as the increment for the slider.

If you click on the Slider tab you will see a few other options. This tab allows you to select the orientation of the slider as well as the length of the slider in pixels. The fixed option will lock its position in the graphics view, if this is not selected the Move tool can move it freely around the window.

4. Change the minimum and maximum to 2 and 10 respectively and change the increment to 1, then select Apply and you should have a slider on the screen with the label a.

5. Do this one more time to get a slider for b. 6. Move the sliders to a convenient position on the screen. 7. To input a function in GeoGebra we use the Input Bar at the bottom. The input bar, in

general, is used for inputting commands that are more difficult than simple constructions. Although this requires the user to learn some syntax the functionality trade-off is worth it. Type the following into the input box and hit enter.

Page 26: GeoGebra Workshop - facultyfp.salisbury.edu · GeoGebra is dynamic mathematics software that joins geometry, algebra and calculus. It is developed for learning and teaching mathematics

GeoGebra Workshop

25

f(x) = (x-1)^a (x-3)^b

At this point you should see the graph of the function and when you move the sliders you should see the graph change dynamically.

8. We will add one more thing to our sketch, a function label. This will require the Insert Text tool which is under the slider tool. Select this tool and click on the graphics window. This will bring up the text tool dialog.

Input

"f(x) = " + f

and select OK. The text in "" will be displayed verbatim, the + is a string concatenation and the last f will be substituted with the current value of the function, it will be dependent on a, b, and c. If you move the sliders at this point not only will the graph change but so will the displayed function label.

Page 27: GeoGebra Workshop - facultyfp.salisbury.edu · GeoGebra is dynamic mathematics software that joins geometry, algebra and calculus. It is developed for learning and teaching mathematics

GeoGebra Workshop

26

The Sine Function Family

This construction is geared to the exploration of the family of curves f(x) = a sin(bx+c)+d. We will implement the constants a, b, c and d as sliders.

1. Start a new sketch. 2. Select the slider tool in the right side of the toolbar. 3. Click on the graphics view. When you do the slider dialog will appear. This dialog allows

you to set the minimum and maximum values for the slider as well as the increment for the slider.

If you click on the Slider tab you will see a few other options. This tab allows you to select the orientation of the slider as well as the length of the slider in pixels. The fixed option will lock its position in the graphics view, if this is not selected the Move tool can move it freely around the window.

4. Select Apply and you should have a slider on the screen with the label a. 5. Do this three more times to get sliders b, c, and d. 6. Move the sliders to a convenient position on the screen. 7. To input a function in GeoGebra we use the Input Bar at the bottom. The input bar, in

general, is used for inputting commands that are more difficult than simple constructions. Although this requires the user to learn some syntax the functionality trade-off is worth it. Type the following into the input box and hit enter.

Page 28: GeoGebra Workshop - facultyfp.salisbury.edu · GeoGebra is dynamic mathematics software that joins geometry, algebra and calculus. It is developed for learning and teaching mathematics

GeoGebra Workshop

27

f(x) = a sin(b x + c) + d

Note that there must be a space between the a and sin as well as the b and x. At this point you should see the graph of the sine function and when you move the sliders you should see the graph change dynamically.

8. We will add one more thing to our sketch, a function label. This will require the Insert Text tool which is under the slider tool. Select this tool and click on the graphics window. This will bring up the text tool dialog.

Input

"f(x) = " + f

and select OK. The text in "" will be displayed verbatim, the + is a string concatenation and the last f will be substituted with the current value of the function, it will be dependent on a, b, c, and d. If you move the sliders at this point not only will the graph change but so will the displayed function label.

Page 29: GeoGebra Workshop - facultyfp.salisbury.edu · GeoGebra is dynamic mathematics software that joins geometry, algebra and calculus. It is developed for learning and teaching mathematics

GeoGebra Workshop

28

The Sine Function: Circle to Function

This construction illustrates how the sine function is created by using the y values of the points on the unit circle.

1. Start a new sketch. 2. Plot a point, A, at the origin. 3. Plot a point, B, at (1, 0). 4. Construct a circle with center A and edge point B. 5. Plot a point, C, on the circle. Make sure you can drag C around the circle. 6. Construct a line segment from A to C. 7. At this point we are going to put in the central angle between AB and AC. To do this

select the Angle tool and then click on B, then A, then C. To get the angle we want we need to click on the defining points in counterclockwise order. This should have produced the angle alpha. Do a drag-test on C to make sure the angle is where we want it.

8. Make sure that the angle measurement is in radians. If it is in degrees go to Options > Angle Unit and select Radians.

9. Now we need to put on the tracing point, D. This point will have x coordinate alpha and y coordinate the same as point C. To plot a point in GeoGebra using its coordinates you simply type in the point in ordered pair form into the input box. The way you get an alpha is with the greek letter button on the right of the input bar and the way you get the y coordinate of C is with y(C). So in the input box type in ( then click the alpha on button to the right then type in , y(C)) and finally hit enter. Do a drag test on C to make sure that this trace point moves along one cycle of the sine function.

10. Construct a line segment from C to D. This will help illustrate to the student that these two points have the same y values.

11. All that remains is to put in one cycle of the sine function and then clean things up a bit. We can do the cycle by either tracing the trace point or by graphing its locus as C moves around the circle. We will do the locus method here and then below we will discuss how to change it to the trace method.

12. Select the Locus tool, it is under the perpendicular line tool section. 13. Click on C and then click on D. At this point the cycle for the sine curve should appear. 14. Do a drag-test on C. 15. Finally, clean things up and make the important parts different colors.

Page 30: GeoGebra Workshop - facultyfp.salisbury.edu · GeoGebra is dynamic mathematics software that joins geometry, algebra and calculus. It is developed for learning and teaching mathematics

GeoGebra Workshop

29

If you would rather use point tracing in place of the locus just make the following changes,

1. Right click on the locus and select the delete option. 2. Right click on the point D (the tracing point) and select Trace On. 3. Do a drag-test on C to get the graph of the sine function.

Page 31: GeoGebra Workshop - facultyfp.salisbury.edu · GeoGebra is dynamic mathematics software that joins geometry, algebra and calculus. It is developed for learning and teaching mathematics

GeoGebra Workshop

30

The Cosine Function: Circle to Function

This construction illustrates how the cosine function is created by using the x values of the points on the unit circle. This is similar to the construction of the sine example but since the values being used for the y values of the function are the x values on the unit circle there is a little more involved in making the construction portray that to the student.

1. Start a new sketch. 2. Plot a point, A, at the origin. 3. Plot a point, B, at (1, 0). 4. Construct a circle with center A and edge point B. 5. Plot a point, C, on the circle. Make sure you can drag C around the circle. 6. Construct a line segment from A to C. 7. At this point we are going to put in the central angle between AB and AC. To do this

select the Angle tool and then click on B, then A, then C. To get the angle we want we need to click on the defining points in counterclockwise order. This should have produced the angle alpha. Do a drag-test on C to make sure the angle is where we want it.

8. Make sure that the angle measurement is in radians. If it is in degrees go to Options > Angle Unit and select Radians.

9. Now we need to put on the tracing point, D. This point will have x coordinate alpha and y coordinate the same as the x coordinate of the point C. To plot a point in GeoGebra using its coordinates you simply type in the point in ordered pair form into the input box. The way you get an alpha is with the greek letter button on the right of the input bar and the way you get the x coordinate of C is with x(C). So in the input box type in ( then click the alpha on button to the right then type in , x(C)) and finally hit enter. Do a drag test on C to make sure that this trace point moves along one cycle of the cosine function.

10. Next we put in the cycle of the cosine. We can do the cycle by either tracing the trace point or by graphing its locus as C moves around the circle. We will do the locus method here and then below we will discuss how to change it to the trace method.

11. Select the Locus tool, it is under the perpendicular line tool section. 12. Click on C and then click on D. At this point the cycle for the cosine curve should appear. 13. Do a drag-test on C. 14. Now comes the more difficult part in this illustration. We want to geometrically take the

x value of the point on the circle, convert it to a y value and link it up with the trace point. 15. Plot the line y = x by typing y = x into the input box and hitting enter. 16. Construct a perpendicular line from C to the x-axis. Select the perpendicular tool click on

C then click on the x-axis. 17. Plot the point of intersection, E, between y = x and the perpendicular. Also plot the point

of intersection of the perpendicular and the x-axis. 18. Hide both y = x and the perpendicular. 19. Construct line segments from A to F, E to F and C to F. I made the first two blue and the

third blue and dotted. 20. Construct the line segment from E to D. 21. Finally, clean things up and make the important parts different colors.

Page 32: GeoGebra Workshop - facultyfp.salisbury.edu · GeoGebra is dynamic mathematics software that joins geometry, algebra and calculus. It is developed for learning and teaching mathematics

GeoGebra Workshop

31

If you would rather use point tracing in place of the locus just make the following changes,

1. Right click on the locus and select the delete option. 2. Right click on the point D (the tracing point) and select Trace On. 3. Do a drag-test on C to get the graph of the cosine function.

Page 33: GeoGebra Workshop - facultyfp.salisbury.edu · GeoGebra is dynamic mathematics software that joins geometry, algebra and calculus. It is developed for learning and teaching mathematics

GeoGebra Workshop

32

Exponential and Logarithmic Family Experiment

Exercise: Create a sketch that has a single slider b ranging from 0 to 10, the functions b^x and log_b(x) along with the line y = x. Note that GeoGebra does not have a log_b(x) function but it does have ln(x), so to do log_b(x) you will need to use the base change formula, ln(x)/ln(b). Also, to make the function labels as in the applet below you want to change the label type to caption and type in the label. For the subscript b in the g(x) label simply use Log_b(x), the _ makes the subscript.

Logistic Function Family

Exercise: Create a sketch that plots the function K/(1 + A e^(-r x)) with sliders to alter the values of K, A and r. In GeoGebra e^x can be done with either e^x or exp(x). Also, to make the function labels as in the applet below you want to change the label type to caption and type in the label.

Page 34: GeoGebra Workshop - facultyfp.salisbury.edu · GeoGebra is dynamic mathematics software that joins geometry, algebra and calculus. It is developed for learning and teaching mathematics

GeoGebra Workshop

33

Logistic Function Curve Fitting

Exercise: Create a sketch that plots the function K/(1 + A e^(-r x)) with sliders to alter the values of K, A and r. In GeoGebra e^x can be done with either e^x or exp(x). Also, to make the function labels as in the applet below you want to change the label type to caption and type in the label.

To plot the data you will follow the same procedure outlined in the curve fitting example. We have copied it below as well,

1. If you were doing the on-line version of this workshop you could click on the provided link to get the set of data points and copy them into the spreadsheet view. In this case you will need to input them yourself.

0.86 1.33

4.84 4.3

3.36 4.28

3.34 4.28

2.38 4.06

6.09 4.3

2.8 4.21

3.82 4.29

0.79 1.18

1.75 3.4

1.8 3.49

4.82 4.3

2.8 4.21

4.65 4.3

6.56 4.3

4.36 4.3

2. Select all of the data in the spreadsheet view, right-click on the data and select Create List of Points. At this point you will see a set of points in a parabolic pattern.

3. The only downside here is that these points are free points, which means that they can be moved by the mouse. Since we do not want that to happen we will make them fixed points. We also do not need to have labels on all the points so we will remove them. We could do all of this from the graphics view but let's look at another feature of GeoGebra. Hit Control-E, this will bring up the object properties dialog box that will let you change any of the properties on any of the objects. On the left you will see a tree view of all of the objects you have in your sketch. One entry should be Point. Click on the + to the left of Point and you should see all of the point names in your sketch. Click on the name Point so that it is highlighted and your dialog should look something like the following.

Page 35: GeoGebra Workshop - facultyfp.salisbury.edu · GeoGebra is dynamic mathematics software that joins geometry, algebra and calculus. It is developed for learning and teaching mathematics

GeoGebra Workshop

34

Check Fix Object and uncheck Show Label and then click the close button. Now your graphics view should look like the applet below. At this point you can close the spreadsheet view.

Page 36: GeoGebra Workshop - facultyfp.salisbury.edu · GeoGebra is dynamic mathematics software that joins geometry, algebra and calculus. It is developed for learning and teaching mathematics

GeoGebra Workshop

35

Calculus

GeoGebra Features

In this sequence of examples we will be starting to look at some more advanced features in GeoGebra. We will be using tangents, locus, slope, piecewise functions, LaTeX text boxes, lower and upper Riemann sums, sequences, lists, check boxes, polygons, and integrals.

GeoGebra has a built-in computer algebra system so taking symbolic derivatives and integrals is easy. Hence making tangent lines to a function simply takes a couple clicks of the mouse. Furthermore, all calculated values are given names so you can bring in any calculation into the defining properties of an object. All this along with the dynamic capabilities of the package allow you to quickly make very impressive demonstrations for a Calculus I or II class.

GeoGebra also has a sophisticated logical parser along with the some programming conditional constructs allow the user to easily create piecewise defined functions or functions on restricted domains. In addition, GeoGebra has a LaTeX parser allowing you to insert LaTeX code into text boxes for better formatting of mathematics.

Another strength of this package is in its list processing capabilities. The program offers many functions for making lists and sequences of calculation results. Furthermore lists are general, you can create lists of objects as well as lists of numbers. For example, the command

Sequence[Circle[A, i], i, 1, 5]

will create a list (and graph) of 5 concentric circles with center at the point A.

Page 37: GeoGebra Workshop - facultyfp.salisbury.edu · GeoGebra is dynamic mathematics software that joins geometry, algebra and calculus. It is developed for learning and teaching mathematics

GeoGebra Workshop

36

When you do a definite integral with GeoGebra not only does GeoGebra calculate the value it will automatically graph the new area. There is also a built-in integral function for finding the area between two given curves.

Page 38: GeoGebra Workshop - facultyfp.salisbury.edu · GeoGebra is dynamic mathematics software that joins geometry, algebra and calculus. It is developed for learning and teaching mathematics

GeoGebra Workshop

37

Graphing the Derivative Using the Slope: Example 1

This construction is a simple setup for your students to see the graphical relationship between a function and its derivative.

1. Start a new sketch. 2. In the Input Bar at the bottom type in

f(x) = x^3 - 5 x^2

at this point you should see the graph of the cubic.

3. If you look at the applets below you will see that the scale on the x and y axes are different. The default for GeoGebra is to keep them the same since this is what you want when doing geometry. There are several ways to change the axes. One way is to right-click on the graphics view and select the x-axis : y-axis option from the pop-up menu and then select the ratio you want. Another way is to select the Move tool, which allows you grab the entire image and move it statically, put your cursor over one of the axis markings and then click and drag. Use either method to bring both relative extrema into view.

4. Select the point tool and put a point on the function. This should be A but if it is not on your sketch go into the properties and change it to A. Do a drag-test to make sure the point is attached to the function.

5. Now we will create the tangent line to the cubic that passes through the point you just put on the line. Select the Tangents tool, this is under the perpendicular tool icon. Click on the point and then click on the cubic, or vice-versa. At this point you should see the tangent line to the cubic passing through the point.

6. Now we will get the slope of the line. Select the Slope tool, it is under the measurements icon that probably has the picture of an angle in it. Now just click on the tangent line. This will produce the standard rise over run triangle and a slope measurement assigned to the variable m.

7. At this point we want a point that has the same x value as A and has a y value that is equal to m. To do this simply type the following into the Input Bar and hit enter.

(x(A), m)

The x(A) extracts the x value of A and of course m is m. This should produce the point B on the sketch that is on the graph of the derivative.

8. At this point we could simply use the locus or trace on B and get the graph of the derivative but we will add in a little more to help the user see how B was constructed. Construct a perpendicular to the x-axis through B.

9. Plot the point of intersection of the perpendicular and the x-axis. 10. Hide the perpendicular and construct a line segment from B to this point of intersection.

Page 39: GeoGebra Workshop - facultyfp.salisbury.edu · GeoGebra is dynamic mathematics software that joins geometry, algebra and calculus. It is developed for learning and teaching mathematics

GeoGebra Workshop

38

11. Since the length of this line is m we would like it to be labeled as m. Select the properties for the segment and in the drop-down box for the label select caption. In the caption box above this type in m. Finally, close the properties box.

12. The last step is to do the locus. Select the locus tool, click on A and then click ob B. At this point you should see the derivative function. Do a drag-test.

Notes:

1. GeoGebra has a built-in computer algebra system so it is capable of calculating a symbolic derivative. So we could have simply typed

f'(x)

into the Input Bar to get the graph of the derivative instead of using the locus.

2. In GeoGebra you can move functions around with the mouse. So if you click and drag the cubic function it will translate, the nifty part is that so will the rest of the sketch. If you want to lock the function, right-click on the function, select the properties option and then under the Basic tab click the Fix Object check box.

If you would rather use point tracing in place of the locus just make the following changes,

1. Right click on the locus and select the delete option. 2. Right click on the tracing point and select Trace On. 3. Do a drag-test.

Page 40: GeoGebra Workshop - facultyfp.salisbury.edu · GeoGebra is dynamic mathematics software that joins geometry, algebra and calculus. It is developed for learning and teaching mathematics

GeoGebra Workshop

39

Page 41: GeoGebra Workshop - facultyfp.salisbury.edu · GeoGebra is dynamic mathematics software that joins geometry, algebra and calculus. It is developed for learning and teaching mathematics

GeoGebra Workshop

40

Graphing the Derivative Using the Slope: Example 2

This construction is another simple setup for your students to see the graphical relationship between a function and its derivative. The construction is exactly the same as the last example except that the function was

f(x) = e^(-x²) and to create the derivative I used

g(x) = f'(x) in place of using the locus tool.

Page 42: GeoGebra Workshop - facultyfp.salisbury.edu · GeoGebra is dynamic mathematics software that joins geometry, algebra and calculus. It is developed for learning and teaching mathematics

GeoGebra Workshop

41

Graphing the Derivative Using the Slope: Example 3

This construction is another simple setup for your students to see the graphical relationship between a function and its derivative. The construction is exactly the same as the first example except that the function was

f(x) = If[x < 2, x, If[x < 5, 2, If[x > 5, -x + 7, 0]]]

and to create the derivative I again used g(x) = f'(x)

in place of using the locus tool.

To do a piecewise defined function in GeoGebra you can use the If construct. The general form of an if statement in GeoGebra is

If [ condition , True Do , False Do ] The condition is any logical statement. The logic connectors can be found in the drop-down box to the right of the Input Bar. The True Do is the statement done if the condition is true and the False Do is the statement done if the condition is false. So our function,

If[x < 2, x, If[x < 5, 2, If[x > 5, -x + 7, 0]]] states that if x < 2 the function is x, if it is greater than or equal to 2 and less than 5 the function is 2, if the x is greater than 5 the function is -x+7 and finally for all other values of x the function is 0.

There is another type of If statement in GeoGebra, of the form,

If [ condition , True Do ] The condition is any logical statement. The logic connectors can be found in the drop-down box to the right of the Input Bar. The True Do is the statement done if the condition is true and nothing is done if the condition is false. So the function

If[x < 5 ^ x > 0, x^3 - 5 x^2] is simply the function x^3 - 5 x^2 but on the domain 0 < x < 5. Note that the ^ between x < 5 and x > 0 is not the keyboard symbol above the 6, it is a special symbol you get in the drop-down box to the right of the Input Bar.

The other new thing in this example is the nifty text box we have in the upper right of the window with the function given in a nice format, almost looks like LaTeX, since it is. To make one of these select the Text tool and click on the Graphics View. At this point a text dialog box will appear.

Page 43: GeoGebra Workshop - facultyfp.salisbury.edu · GeoGebra is dynamic mathematics software that joins geometry, algebra and calculus. It is developed for learning and teaching mathematics

GeoGebra Workshop

42

The default is text mode so it you typed in anything it would be displayed as text. Since we want LaTeX for this box click on the LaTeX Formula check box and copy in the following.

f(x) = \left\{ \begin{array}{lr} x & x < 2 \\ 2 & 2 \leq x < 5 \\ -x+7 & 5 \leq x \end{array} \right.

Finally, click the OK button and you have the text.

Page 44: GeoGebra Workshop - facultyfp.salisbury.edu · GeoGebra is dynamic mathematics software that joins geometry, algebra and calculus. It is developed for learning and teaching mathematics

GeoGebra Workshop

43

Optimization Example

This construction is a simple optimization experiment that we all do in Calculus I. A person is standing at point A along the bank of a river that is 5 miles wide and needs to get to the other side of the river to point B that is 10 miles downstream. The person can move at 5 miles per hour over land and 3 miles per hour over water. Where should they start across the water (point C) to minimize their total travel time?

Most of the work in this construction is to make the image look good.

1. Start a new sketch. 2. Construct an infinite line, This will be one bank of the river. This will also construct two

points A and B. 3. Now we want a parallel line to this one that is 5 units away. Select the Circle with Radius

tool, it is under the circle tools. Click on point A and then enter 5 in the dialog box that appears.

4. Construct a perpendicular to the first infinite line through A. 5. Plot the point of intersection between the perpendicular and the circle. 6. Hide the perpendicular and circle and construct a line segment from the intersection point

to A. Change the label of the line segment to its value, which should be 5. 7. Construct a line parallel to the first infinite line through the intersection point above.

There is a parallel line tool under the perpendicular line tool icon. 8. At this point we want to create a point on the first infinite line that is 10 units from A. To

do this we will again use the Circle with Radius tool. Construct a circle with radius 10 and center A, plot the point of intersection between this circle and the infinite line. Create a segment between this point and A and change its label to its value, which should be 10.

9. Place a point on the upper bank (this will be the cross over point) and hide everything except the beginning point, ending point, crossover point, the two banks and the width measurement segment.

10. Rename the points A, B and C as in the applet below. 11. Construct segments from A to C and C to B, make them both red and hide their labels.

We will put in more informative labels shortly. 12. Type the following into the Input Bar, the calculation of the total travel time.

j / 5 + k / 3

13. Construct three text boxes with the following inputs,

j + " miles at 5 Mi/hr " + " = " + (j / 5) + " Hours"

k + " miles at 3 Mi/hr " + " = " + (k / 3) + " Hours" and

Page 45: GeoGebra Workshop - facultyfp.salisbury.edu · GeoGebra is dynamic mathematics software that joins geometry, algebra and calculus. It is developed for learning and teaching mathematics

GeoGebra Workshop

44

"Total Time = " + l + " Hours"

where j is the name of the segment AC, k is the name of the segment CB and l is the name of the calculation from the previous step.

14. Increase the font size of each of the text boxes. This is under the Text tab in their options. 15. The total time box can be moved to the bottom of the sketch. The other two we are going

to attach to the segments they are measuring. GeoGebra can only attach a text box to a point, not a segment, so we will construct the midpoint of the two segments and attach the boxes to them.

16. Select the midpoint tool and plot the midpoints to the segments AC and CB. 17. Go into the properties of one of the text boxes, select the Position tab, and then select the

point name of the midpoint of the segment. Do the same for the other text box. 18. Hide the midpoints. Do a drag test to see the labels move with the segments. You can

move the label with the mouse as well but it will stay within a reasonable circle around the point it is attached to.

19. At this point we need only put in the water, frankly an optional step. To do so zoom out a little, put two points on each bank that are outside the important objects of the sketch. Select the polygon tool and click the four points in a counter-clockwise (or clockwise) order returning to the first point as the last click.

20. Right-click on the polygon and change its color to blue.

Page 46: GeoGebra Workshop - facultyfp.salisbury.edu · GeoGebra is dynamic mathematics software that joins geometry, algebra and calculus. It is developed for learning and teaching mathematics

GeoGebra Workshop

45

Lower and Upper Riemann Sums

Lower and upper sums in GeoGebra are a snap since they are built in functions.

1. Start a new sketch. 2. Plot the function f(x) = x^2 - 3 x 3. Plot points A and B on the x-axis. 4. Create a slider that goes from 5 to 50 in increments of 1 with name n. 5. Input the following into the Input Bar,

LowerSum[f(x), x(A), x(B), n]

6. Input the following into the Input Bar,

UpperSum[f(x), x(A), x(B), n]

Page 47: GeoGebra Workshop - facultyfp.salisbury.edu · GeoGebra is dynamic mathematics software that joins geometry, algebra and calculus. It is developed for learning and teaching mathematics

GeoGebra Workshop

46

Left and Right Riemann Sums

Right and left Riemann sums are not as easy since they are not built-in functions. If they are I missed them. This does give us an opportunity to look at some more advanced commands in GeoGebra, specifically the list processing capabilities, and a couple more objects.

1. Start a new sketch. 2. Plot the function f(x) = x^2 + 1 3. Plot points A and B on the x-axis. 4. Create a slider that goes from 5 to 50 in increments of 1 with name n. 5. Input the following into the Input Bar,

dx = (x(B) - x(A)) / n

good old delta x.

6. Input the following into the Input Bar,

subint = Sequence[x(A) + i dx, i, 0, n]

good old x_i. The sequence command is doing what you would guess, taking i from 0 to n and making a list of the n+1 values x(A) + i dx.

7. Input the following into the Input Bar,

left = Take[subint, 1, n]

This is taking elements numbered 1 to n from the list subint and creating a list called left. Element numbering in a list starts at 1 so this is a list of left hand endpoints.

8. Input the following into the Input Bar,

right = Take[subint, 2, n + 1]

This is taking elements numbered 2 to n+1 from the list subint and creating a list called right. This is a list of right hand endpoints.

9. Input the following into the Input Bar,

rightheights = f(right)

This command is taking the entire list right, applying f to it and creating a list rightheights of the output. So this is a list of the heights of the rectangles using the right hand endpoints.

10. Input the following into the Input Bar,

Page 48: GeoGebra Workshop - facultyfp.salisbury.edu · GeoGebra is dynamic mathematics software that joins geometry, algebra and calculus. It is developed for learning and teaching mathematics

GeoGebra Workshop

47

leftheights = f(left)

This is a list of the heights of the rectangles using the left hand endpoints.

11. This one is not so easy, but it does a lot. Input the following into the Input Bar,

rightRect = Sequence[Polygon[(Element[left, i], 0), (Element[right, i], 0), (Element[right, i], Element[rightheights, i]), (Element[left, i], Element[rightheights, i])], i, 1, n]

This creates a sequence of polygons with points

(Element[left, i], 0) (Element[right, i], 0) (Element[right, i], Element[rightheights, i]) (Element[left, i], Element[rightheights, i])

where Element[right, i] extracts the the ith element from the right list. In other words we are creating all of the rectangles for the right Riemann sum.

12. To create all of the left sum rectangles input the following into the Input Bar,

leftRect = Sequence[Polygon[(Element[left, i], 0), (Element[right, i], 0), (Element[right, i], Element[leftheights, i]), (Element[left, i], Element[leftheights, i])], i, 1, n]

13. To calculate the actual left and right sums simply input the following into the Input Bar.

leftSum = Sum[leftheights] dx

and

rightSum = Sum[rightheights] dx

The Sum command simply takes the sum of the list elements.

14. Now create text boxes to display the left sum and right sum. The text in these should be

"Left Sum = " + leftSum

and

"Right Sum = " + rightSum

15. The only thing that remains to make our sketch look like the one below is to put in check boxes and link the rectangles and text boxes to them so that when the check box is not checked the appropriate sum is hidden. GeoGebra has a nifty option for all objects, which is a condition that the object is seen. If the condition is true the object is visible and if not

Page 49: GeoGebra Workshop - facultyfp.salisbury.edu · GeoGebra is dynamic mathematics software that joins geometry, algebra and calculus. It is developed for learning and teaching mathematics

GeoGebra Workshop

48

it is hidden. Usually an object is always on or always off or if the object becomes undefined it will be hidden. What we will do is create the two check boxes and set the rectangles and text boxes condition to the check box. So first create a check box with label Right Sum. The check box tool is under the slider icon. When the dialog box appears put Right Sum in the caption area and then in the drop down box select the rightRect entry and then the text box for the right sum.

Now do the same for the left sum. Check and uncheck these to make sure that they do what is needed.

16. This step is not needed I just want to show you the object conditions. Bring up the properties for one of the text boxes.

Notice that the condition is set to b, which is the name of the check box and hence its value (true or false). In general, these conditions can be any logical statement. For

Page 50: GeoGebra Workshop - facultyfp.salisbury.edu · GeoGebra is dynamic mathematics software that joins geometry, algebra and calculus. It is developed for learning and teaching mathematics

GeoGebra Workshop

49

example, if you wanted some object to appear only when the y value of point G is greater than 0 you would simply put y(G) > 0 into the objects condition.

17. At this point you might want to clean things up a bit and alter some colors.

Page 51: GeoGebra Workshop - facultyfp.salisbury.edu · GeoGebra is dynamic mathematics software that joins geometry, algebra and calculus. It is developed for learning and teaching mathematics

GeoGebra Workshop

50

Net Area Exploration

This exploration is the counterpart to the ones from the differential section which used the slope of the tangent lines to graph the derivative. This one uses net area to graph the integral of the function. Another new thing in this sketch is to put LaTeX code with dynamic values into a text box.

1. Start a new sketch. 2. Plot the function, f(x) = x^2 - 3 x 3. Plot points A and B on the x-axis. 4. Construct perpendicular lines to the x-axis through A and B. 5. Construct the points of intersection of these perpendiculars to the function. 6. Hide the perpendiculars, construct line segments in their place and then hide the

intersection points. 7. Input the following into the Input Bar,

NetArea = Integral[f(x), x(A), x(B)]

This is obviously the definite integral of f(x) from A to B. Just as a side note GeoGebra can take the indefinite integral of a function as well, the syntax here is simply Integral[f(x)].

8. Now we will plot a point on the graph of the integral. Input the following into the Input Bar,

(x(B), NetArea)

This will produce a new point on the sketch, we will call it D.

9. Locus time, create a locus with B and D in that order. 10. Just for pedagogical reasons put in a segment from B to D, hide the label of D, change the

label for the integral to Name and Value, make the caption for the segment BD say Net Area, and set the label of the function to Name and Value as well.

11. Last thing to do is put that nifty label on the point D. Create a text box and put the following in for the text.

"Net \; Area \; = \int_A^B f(x) \; dx \; = \; " + NetArea

The stuff inside the "" is LaTeX (the \; just puts in a little more space) the + is string concatenation and NetArea is the value to print out. Do a drag-test. Now select the text box properties, the Position tab and select the starting point as point D.

12. Do some color changes and font size changes.

Page 52: GeoGebra Workshop - facultyfp.salisbury.edu · GeoGebra is dynamic mathematics software that joins geometry, algebra and calculus. It is developed for learning and teaching mathematics

GeoGebra Workshop

51

Page 53: GeoGebra Workshop - facultyfp.salisbury.edu · GeoGebra is dynamic mathematics software that joins geometry, algebra and calculus. It is developed for learning and teaching mathematics

GeoGebra Workshop

52

More Features & Examples

GeoGebra Features

In this series of example we will look at some advanced features of GeoGebra, how to create applets out of your sketches, how to give the user control over what they can do with the applet and how much they can do and discuss how to create user-defined tools.

In this series of examples we will begin to look at a few more advanced features and use some of the ones from the previous examples in new ways. One very powerful feature is the sequence and list commands. These can produce arrays of values and objects that can make sequential processes easy to do and results from them easy to graph. we will also look at some more features of the spreadsheet interface.

GeoGebra makes exporting your sketched to the web a snap. Since GeoGebra was written in Java it functions just as well as an applet as it does an application. So to put your sketches on your web pages all you need to do is upload a few files along with your GeoGebra sketch and you are done. No programming is necessary and in fact GeoGebra has an interface that allows you to insert text before and after the applet position so you don't even need to edit the HTML if you do want to.

We will also discuss the different methods for the user to interact with your applets. GeoGebra Applets are not read only demonstrations. You can set them up so that the user cannot add or remove anything from them, as with most of the applets in this

workshop. But in general you can give the user the ability to add, remove and alter the contents of the sketch. In the export option for the sketch under the advanced tab you may select what parts of the GeoGebra system to make available, from practically nothing to everything. So one way to give the user access to alter the sketch is to allow them the toolbar, menu bar, algebra

view and input bar, as below. Essentially putting all of GeoGebra on the web page.

GeoGebra also has an extensive JavaScript interface that allows the user to change items in the applet through web forms you create. As with GSP,

Page 54: GeoGebra Workshop - facultyfp.salisbury.edu · GeoGebra is dynamic mathematics software that joins geometry, algebra and calculus. It is developed for learning and teaching mathematics

GeoGebra Workshop

53

GeoGebra has the capability of allowing the user to create their own tools. In GeoGebra you can create tools from your sketches and save them in a tool file that can be read from any other GeoGebra window. Furthermore, the tool creation process also creates a new command. So the user can either use the tool or the command to invoke the process.

Page 55: GeoGebra Workshop - facultyfp.salisbury.edu · GeoGebra is dynamic mathematics software that joins geometry, algebra and calculus. It is developed for learning and teaching mathematics

GeoGebra Workshop

54

Web Diagrams

One of the most informative visualizations in dynamical systems is the web diagram. In this example we will construct a web diagram viewer for the one parameter family of functions, kx(1-x). Furthermore, we will set up a slider to move through the family, a moveable seed and we will track the first 200 iterations in the spreadsheet view.

1. Start a new sketch. 2. Plot the line y = x. 3. Construct a point on the x-axis, if it is not A, change its label to A. 4. Put in a slider with name k that goes from 0 to 4 in increments of 0.01. 5. Plot the function f(x) = k x (1-x). 6. Define Iter to be 200 with the command Iter = 200 7. We will now create a list of values of the iterations of the function, enter the following

command into the Input Bar.

values = IterationList[f, x(A), Iter]

8. At this point we are going to draw the web, the first line we will do outside of the list, enter the following command into the Input Bar.

Segment[A, (x(A), f(x(A)))]

9. Enter the following command into the Input Bar,

cobwebHorizontal = Sequence[Segment[(Element[values, i], Element[values, i + 1]), (Element[values, i + 1], Element[values, i + 1])], i, 1, Iter - 1]

This will create all of the horizontal web segments.

10. Enter the following command into the Input Bar,

cobwebVertical = Sequence[Segment[(Element[values, i], Element[values, i]), (Element[values, i], Element[values, i + 1])], i, 2, Iter]

This will create all of the vertical web segments.

11. Enter the following command into the Input Bar,

points = Sequence[(Element[values, i - 1], 0), i, 2, Iter]

This will create a list of the iteration points on the x-axis.

12. Enter the following command into the Input Bar,

endpoints = Sequence[(Element[values, i - 1], 0), i, Iter / 2, Iter]

Page 56: GeoGebra Workshop - facultyfp.salisbury.edu · GeoGebra is dynamic mathematics software that joins geometry, algebra and calculus. It is developed for learning and teaching mathematics

GeoGebra Workshop

55

This will create a list of the last half of the iteration points on the x-axis.

13. Create a text box with the function in it, and two check boxes linked to the points and the endpoints.

14. The only thing left is to display the iterations in the spreadsheet. Turn on the spreadsheet view. In the A1 cell input =x(A) and in the A2 cell input =f(A1). Now copy the A2 cell down to A200.

15. Clean the sketch up and change some of the colors. Do a drag-test.

Page 57: GeoGebra Workshop - facultyfp.salisbury.edu · GeoGebra is dynamic mathematics software that joins geometry, algebra and calculus. It is developed for learning and teaching mathematics

GeoGebra Workshop

56

One Parameter Family Iterates

This is also a neat visualization for dynamical systems, it displays what happens when the system bifurcates and allows the use to see the nature of the bifurcation. This is an easy one.

1. Start a new sketch. 2. Plot the line y = x. 3. Put in a slider with name k that goes from 0 to 4 in increments of 0.01. 4. Plot the function f(x) = k x (1-x). 5. Plot the function g(x) = f(f(x)). 6. Plot the function h(x) = f(f(f(x))). 7. Plot the function m(x) = f(f(f(f(x)))). 8. Make a text box displaying the function f.

Page 58: GeoGebra Workshop - facultyfp.salisbury.edu · GeoGebra is dynamic mathematics software that joins geometry, algebra and calculus. It is developed for learning and teaching mathematics

GeoGebra Workshop

57

Generalized Parabolas

I got this from a talk by Greg Hartman and Dan Joseph of VMI at one of our MAA section meetings. The idea was simple, as we all know the parabola is defined as the locus of points that are equal distant from a fixed straight line and fixed point. What happens if you let the line be a curve instead of a straight line? This series of three applets will examine this question.

First we will construct the parabola so that we have a method for the more general case.

1. Start a new sketch. 2. Plot an infinite line. 3. Plot a point not on the line (C) and plot a point on the line (D). 4. Plot a perpendicular to the line through D. 5. Plot the segment CD. 6. Plot the perpendicular bisector to CD. 7. Plot the point of intersection of the two perpendiculars (E). 8. Create a locus using D as the driver and E as the point on the locus. 9. Do a drag-test and clean things up a bit. This should give you a sketch like the one below.

The authors then did something neat, they replaced the straight line with a circle. They wanted to be able to increase the radius of the circle indefinitely, thus producing a straight line when the circle's radius was infinite. To do this we will use a circle through three points.

1. Start a new sketch. 2. Plot three points. 3. Select the circle through three points tool and then click on the three points you just

created. 4. Plot a point not on the circle (D) and plot a point on the circle (E). 5. Plot a tangent line to the circle through E and plot a perpendicular to that line through E. 6. Plot the segment DE. 7. Plot the perpendicular bisector to DE. 8. Plot the point of intersection of the two perpendiculars (G). 9. Create a locus using E as the driver and G as the point on the locus. 10. Do a drag-test and clean things up a bit. This should give you a sketch like the one below.

Page 59: GeoGebra Workshop - facultyfp.salisbury.edu · GeoGebra is dynamic mathematics software that joins geometry, algebra and calculus. It is developed for learning and teaching mathematics

GeoGebra Workshop

58

What was so nifty about this was that when D was inside the circle the locus was an ellipse, when the D was outside the circle the locus was a hyperbola and when the radius of the circle was infinite the locus was a parabola. I authors proved this to be the case and showed that the point D was always one of the foci. So the parabola construction gives all three conic sections when you use a circle.

The authors then went on to investigate other curves. We will simply use a parabola here.

1. Start a new sketch. 2. Plot f(x) = 1/10 x^2 3. Plot a point not on the parabola (A) and plot a point on the parabola (B). 4. Plot a tangent line to the parabola through A and plot a perpendicular to that line through

A. 5. Plot the segment AB. 6. Plot the perpendicular bisector to AB. 7. Plot the point of intersection of the two perpendiculars (C). 8. Create a locus using B as the driver and C as the point on the locus. 9. Do a drag-test and clean things up a bit. This should give you a sketch like the one below.

Page 60: GeoGebra Workshop - facultyfp.salisbury.edu · GeoGebra is dynamic mathematics software that joins geometry, algebra and calculus. It is developed for learning and teaching mathematics

GeoGebra Workshop

59

Another Optimization Example

This is a standard optimization exercise that I like to give to my Calculus I students. Take an 8.5 by 11 inch piece of paper, fold one corner down to the opposite side, how should the paper be folded so that the length of the fold is minimized. This construction is on the lengthy side. Getting the fold portion is not too bad but to get it to go beyond the opposite corner takes a little doing.

1. Start a new sketch. 2. Plot a point A. 3. Construct a circle through A with radius 11. 4. Plot a point B on that circle. 5. Construct the line segment AB. 6. Construct a circle through A with radius 8.5. 7. Construct a perpendicular to AB through A. 8. Plot the point of intersection between the perpendicular and the 8.5 circle, C. 9. Construct a perpendicular to AC through C. 10. Construct a perpendicular to AB through B. 11. Plot the point of intersection (D) of the perpendiculars through C and B. 12. Clean things up a bit, hide all lines and circles except for the segment AB. Put in

segments AC, CD and BD. This should make the piece of paper. 13. Construct the midpoint of BD, call it E. Hide BD and construct the segment BE. 14. Construct a point on BE, call it G. This is one endpoint to the fold. The reason we put it

on half of BD is because physically it could not be any higher. 15. Construct a circle with center G through D. 16. Plot the point of intersection between this circle and the segment AB, call it F. 17. Construct the segment FG. This segment is the folded part of the side BD. 18. Construct a perpendicular to FG through F. This is the folded portion of the top edge of

the paper. 19. Plot the point of intersection between this last perpendicular and CD, call it H. 20. Construct the line segment GH. This is what you want to minimize so change the label to

the value. 21. Time to clean again, hide the circle, the line FH, the segment CD, the segment BE, the

point D and the point E. 22. Construct segments BG, HF and CH. The length of segment BG is what we want as a

final answer to the exercise so replace its label with its value. At this point you have a sketch that is sufficient for the exercise. Note that when you do a drag test on G the fold works as it would in reality until the point H hits C then the segments GH and FH disappear. This is because the point H is undefined in these cases. So the remainder of this construction is to make it look like the paper is folding correctly when H passes C. If you want to stop here you might want to clean things up a bit. If you want to do the upper fold continue.

23. Unhide the perpendicular to FH through F. 24. Plot the point of intersection between AC and this perpendicular, call it N. 25. Construct a circle with center F and radius 11. 26. Plot the point of intersection between FN and this circle, call it M.

Page 61: GeoGebra Workshop - facultyfp.salisbury.edu · GeoGebra is dynamic mathematics software that joins geometry, algebra and calculus. It is developed for learning and teaching mathematics

GeoGebra Workshop

60

27. Hide the perpendicular through F, hide N and hide the circle. 28. Construct segment FM. 29. Construct segment MC. 30. Construct the perpendicular bisector of MC. 31. Plot the point of intersection of this perpendicular with AC, call it P. 32. Construct the segment PM. Note that PM and PC have the same length. 33. Do a drag-test on G. Note that we are almost there, we simply want to have the program

distinguish between the two cases, the fold meeting the top edge and the fold meeting the left edge. These cases can be distinguished by looking at the y value of the point M and y value of the point C. If the y value of M is larger than that of C the fold intersects the top edge and if the y value of M is less than that of C the fold intersects the left edge.

34. Hide the infinite line through G. 35. Bring up the properties for the point M. Click the Advanced tab and put y(M) <& y(C) in

the Condition to Show Object box. 36. Do a drag test on G. You will see that we need to put the same condition on segment FM.

Do so. Also hide MC, it is not needed in the remainder of the construction. At this point the case where we intersect the top edge is finished. We simply need to do some clean up on the case where we intersect the left edge.

37. Construct the segment GP and change its label to its value. 38. Besides getting rid of some of the labels there is only one thing we need to do. When we

intersect the left edge we want the left edge to be AP and not AC. Use the condition y(M) > y(C) for the segment AC and the point C.

39. Construct the segment AP and use its show condition as y(M) <& y(C). 40. Do a drag-test. It should be working at this point. Clean things up a bit and you are done.

Page 62: GeoGebra Workshop - facultyfp.salisbury.edu · GeoGebra is dynamic mathematics software that joins geometry, algebra and calculus. It is developed for learning and teaching mathematics

GeoGebra Workshop

61

Yet Another Optimization Example

This is another standard optimization exercise that I like to give to my Calculus I students. There is a 90 degree turn going from a hall that is 9 feet wide to a hall that is 6 feet wide. What is the length of the longest pipe that will go around this corner? I like this one since to maximize the length of the pipe you must minimize the length of the line. This construction is not too bad, we will leave it you to construct.

Page 63: GeoGebra Workshop - facultyfp.salisbury.edu · GeoGebra is dynamic mathematics software that joins geometry, algebra and calculus. It is developed for learning and teaching mathematics

GeoGebra Workshop

62

Making Applets from your Sketches

Making applets from your sketches is easy with GeoGebra. After you create your sketch set up the views the same way you want the applet to appear to the user. That is, if you do not want the applet to display the algebra view, hide the algebra view. Then select File > Export > Dynamic Worksheet as Webpage (html) from the main menu. When you do the following dialog box will appear.

Under the General tab you can set the title, author, date, the text to be placed above the applet and the text to be placed below the applet. Furthermore, you can set the style of how the applet starts. The options here are to embed the applet in the page or to display a button that when pressed opens up an applet window.

Page 64: GeoGebra Workshop - facultyfp.salisbury.edu · GeoGebra is dynamic mathematics software that joins geometry, algebra and calculus. It is developed for learning and teaching mathematics

GeoGebra Workshop

63

Under the Advanced tab are options for what you want the user to see, the interface functionality and the way that the files will be saved. These options are up to you but for most applications you will want to select the ggb file and jar files at the bottom of the dialog box. What this will do is save the current sketch as a standard GeoGebra file, create an HTML file that loads the applet and copies the files

geogebra.jar geogebra_cas.jar geogebra_export.jar geogebra_gui.jar geogebra_main.jar geogebra_properties.jar to the same folder. Now if you copy all of these files to the same folder on a web server you are done. The html file with the applet is on your web site.

Note that if you are placing several applet pages on your site you only need to copy the jar files one time. Just make sure that all of your html files, GeoGebra files and these jar files are in the same folder. Also note that if you simply export the files without filling out the options you can extract the applet tag and place it into another web page. Just remember to move the GeoGebra file to the same folder as the jar and HTML files.

Page 65: GeoGebra Workshop - facultyfp.salisbury.edu · GeoGebra is dynamic mathematics software that joins geometry, algebra and calculus. It is developed for learning and teaching mathematics

GeoGebra Workshop

64

User Interaction with Applets

GeoGebra Applets are not read only demonstrations. You can set them up so that the user cannot add or remove anything from them, as with most of the applets in this workshop. But in general you can give the user the ability to add, remove and alter the contents of the sketch. In the export option for the sketch under the advanced tab you may select what parts of the GeoGebra system to make available, from practically nothing to everything. So one way to give the user access to alter the sketch is to allow them the toolbar, menu bar, algebra view and input bar, as below. Essentially putting all of GeoGebra on the web page. In this setup the help system will usually not find the help files, so if you want the help system to be available to the user you can place a link to it. (http://www.geogebra.org/help/docuen/)

Keep in mind that Java applets have system access restrictions so although the user can use GeoGebra through the web page they will not be able to save their work or even copy some things to the clipboard. There is a way around this if you want to give the user access to file and clipboard systems. That is to use the signed jar files in place of the unsigned ones. The HTML Export feature will copy the unsigned jar files with the GeoGebra and HTML files, you will want to replace these with the signed versions. If you installed GeoGebra on a Windows system then the signed jar files will be in C:\Program Files\GeoGebra. If you use the signed versions, when the user visits your page for the first time they will need to accept the program. Another technical point when setting up an applet start, you need to replace the "java_arguments" applet parameter line with the following.

<param name="java_arguments" value="-Xmx512m -Djnlp.packEnabled=true"/> If you don't want to give the user that much control over the contents but still want them to be able to change some things and you don't mind getting your hands a little dirty you can use the JavaScript interface to GeoGebra. Basically, this allows the user to change items in the applet through web forms you create. This might sound nasty but is it a snap. We have an example

Page 66: GeoGebra Workshop - facultyfp.salisbury.edu · GeoGebra is dynamic mathematics software that joins geometry, algebra and calculus. It is developed for learning and teaching mathematics

GeoGebra Workshop

65

below. This applet simply takes the function f(x) and plots it along with its derivative. We do not give any control to the user through tools or the Input Bar but we have created a small form below the applet that allows the user to change the function. Simply change the function and select the Change Function button.

Here is how this works. If you look at the HTML code of the page that GeoGebra generates for you you will see an applet tag like the one below. This is what loads in the applet and sets the applet options.

<applet name="ggbApplet" code="geogebra.GeoGebraApplet" archive="geogebra.jar" codebase="./" ... Notice the name is name="ggbApplet", this is the default name given to a GeoGebra applet. This name can be changed and if you put more than one applet on a page you should change their names. Now to create the form you simply need to copy the following into your HTML file. <form> <p align=center> Change function: <b>f(x)=</b> <input type="text" name="T1" size="20" value="x^3-2 x^2" > <input type="button" value="Change Function" name="B1" onclick="document.ggbApplet.evalCommand('f(x)='+T1.value);"> <input type="button" value="Reset" name="B2" onclick="T1.value='x^3-2 x^2';document.ggbApplet.reset();">

Page 67: GeoGebra Workshop - facultyfp.salisbury.edu · GeoGebra is dynamic mathematics software that joins geometry, algebra and calculus. It is developed for learning and teaching mathematics

GeoGebra Workshop

66

</p> </form>

The line

<input type="text" name="T1" size="20" value="x^3-2 x^2" >

creates the text box, names it T1 and loads in the string x^3-2 x^2. The line

<input type="button" value="Change Function" name="B1" onclick="document.ggbApplet.evalCommand('f(x)='+T1.value);">

creates the Change Function button. What this button does is evaluates the command, 'f(x)='+T1.value, which takes the text out of the text box and sets it to the function f(x). Note that in the sketch the function to be derived is f(x). The line

<input type="button" value="Reset" name="B2" onclick="T1.value='x^3-2 x^2';document.ggbApplet.reset();">

creates the Reset button. What this button does is resets the sketch and replaces the text in the text box with x^3-2 x^2. Note that in the sketch the original function was x^3-2 x^2. Also note that if you change the name of the applet you need to change the ggbApplet to the new name in both of the buttons.

There is one other addition I like to make to this form. If you use the form as it is displayed above, if the user hits enter when the cursor is in the text box the page will reload. This is probably not what the user wants to happen. To keep this from happening we can lock out the enter key by adding the command

onKeyPress="return disableEnterKey(event)"

to the text box and adding the disableEnterKey function to the page. So the text box will change to

<input type="text" name="T1" size="20" value="x^3-2 x^2" onKeyPress="return disableEnterKey(event)">

and we add the following script to the head of the page.

<script type="text/javascript"> <!-- function disableEnterKey(e) { var key; if(window.event)

Page 68: GeoGebra Workshop - facultyfp.salisbury.edu · GeoGebra is dynamic mathematics software that joins geometry, algebra and calculus. It is developed for learning and teaching mathematics

GeoGebra Workshop

67

key = window.event.keyCode; //IE else key = e.which; //firefox if(key == 13) return false; else return true; } //--> </script> This construct allows the user to alter one item of the sketch, in this case f(x). So if you want the user to be able to change a second item all you need to do is add another one of these constructs to your web page. The only thing you need to do in addition is to change the names of the text box and buttons. Make sure you change the names everywhere, for example, if you rename the text box to TB2 and the buttons to BT1 and BT2 and we are changing the value of r in the sketch (say the original value of r is 5) your form would look like, <form> <p align=center> Change r: <b>r=</b> <input type="text" name="TB2" size="20" value="5" > <input type="button" value="Change r" name="BT1" onclick="document.ggbApplet.evalCommand('r='+TB2.value);"> <input type="button" value="Reset" name="BT2" onclick="TB2.value='5';document.ggbApplet.reset();"> </p> </form> If you are familiar with JavaScript you can probably see other possibilities. For example, you could make both changes in a single form, <form> <p align=center> Change function: <b>f(x)=</b> <input type="text" name="T1" size="20" value="x^3-2 x^2" > Change r: <b>r=</b> <input type="text" name="TB2" size="20" value="5" > <input type="button" value="Make Changes" name="B1" onclick="document.ggbApplet.evalCommand('f(x)='+T1.value); document.ggbApplet.evalCommand('r='+TB2.value);"> <input type="button" value="Reset" name="B2" onclick="T1.value='x^3-2 x^2';TB2.value='5';document.ggbApplet.reset();"> </p> </form>

Page 69: GeoGebra Workshop - facultyfp.salisbury.edu · GeoGebra is dynamic mathematics software that joins geometry, algebra and calculus. It is developed for learning and teaching mathematics

GeoGebra Workshop

68

There are many more options for the JavaScript interface to GeoGebra. If you are interested in developing interactive applets you will want to consult the GeoGebra documentation and user forum at www.geogebra.org.

Page 70: GeoGebra Workshop - facultyfp.salisbury.edu · GeoGebra is dynamic mathematics software that joins geometry, algebra and calculus. It is developed for learning and teaching mathematics

GeoGebra Workshop

69

User Defined Tools

In this example we will take a construction, make two user defined tools and save them to a tools file. Download the file CircumcenterTools.ggb to your computer and open it up in GeoGebra. This is simply a construction of the circumcenter and circumcircle of a triangle. The sketch should look like the figure below.

We will create two tools, the first will be the circumcenter. Select Tools > Create New Tool. At this point the following dialog box will appear.

Page 71: GeoGebra Workshop - facultyfp.salisbury.edu · GeoGebra is dynamic mathematics software that joins geometry, algebra and calculus. It is developed for learning and teaching mathematics

GeoGebra Workshop

70

Using the drop-down box select the object to be produced, in this case the circumcenter point. The point will be listed in the box below when you select it. Note that although we are selecting only one object we can select as many as we would like. Simply select a second, third, ... from the drop-down box. If you select one you do not want you can remove it by highlighting it and clicking the X button.

Click the Next button. At this point you will see the objects that your final object depends on. In this case, it is the three points A, B and C. Click the Next button.

Finally, give the tool a name, command and tool tip. You can also load in an icon for it if you wish. We will call the tool Circumcenter, the command will be the same and the tool tip will be to select three points. Click Finish and you are done.

Page 72: GeoGebra Workshop - facultyfp.salisbury.edu · GeoGebra is dynamic mathematics software that joins geometry, algebra and calculus. It is developed for learning and teaching mathematics

GeoGebra Workshop

71

Now you have a circumcenter tool that when selected you can click on three points and the circumcenter for that triangle will be produced. Furthermore, you have also created a new command. If you create three new points D, E and F you could create the circumcenter of that triangle using the command Circumcenter[D,E,F] in the input bar.

Now do the same process to create a tool for the Circumcircle. Notice that once you do the user defined tools will have a small triangle in the lower right, indicating that there are several tools in this menu.

Now if we save this file we will also save the new tools we created, but what if we want to use these tools in a new sketch? Well all we need to do is save the tools as a GeoGebra Tools file (*.ggt). To do this select Tools > Manage Tools... from the main menu. When you do, the following dialog box will appear.

To save the tools first select all of the tools in the list, GeoGebra will only save the ones that are highlighted. Then click the Save as... button, give the file a name and click OK. At this point your tools are saved. To load them into another sketch all you need to do is select File > Open... from the main menu and select the file you just saved.