Difference between revisions of "GeoGebra-5.04/C3/Scripting-and-LaTeX-in-GeoGebra/English"

From Script | Spoken-Tutorial
Jump to: navigation, search
 
(One intermediate revision by one other user not shown)
Line 30: Line 30:
 
|| To record this tutorial, I am using;  
 
|| To record this tutorial, I am using;  
  
'''Ubuntu Linux''' '''OS''' version 18.04  
+
*'''Ubuntu Linux''' '''OS''' version 18.04  
  
'''GeoGebra''' version 5.0660.0-d
+
*'''GeoGebra''' version 5.0660.0-d
  
'''TeXworks''' version 0.6.3
+
*'''TeXworks''' version 0.6.3
  
The commands shown in this tutorial will work in all 5.0x versions of '''GeoGebra'''.  
+
The '''commands''' shown in this tutorial will work in all 5.0x versions of '''GeoGebra'''.  
 
|-
 
|-
 
|| '''Slide Number 4'''  
 
|| '''Slide Number 4'''  
Line 48: Line 48:
  
 
You should be familiar with '''GeoGebra''' and '''LaTeX'''.
 
You should be familiar with '''GeoGebra''' and '''LaTeX'''.
 +
  
 
For the prerequisite '''GeoGebra''' and '''LaTeX '''tutorials please visit this website.  
 
For the prerequisite '''GeoGebra''' and '''LaTeX '''tutorials please visit this website.  
Line 70: Line 71:
  
  
The commands used in this tutorial are available in '''scripting-commands.txt ''' file.  
+
The '''commands''' used in this tutorial are available in '''scripting-commands.txt ''' file.  
  
  
Line 83: Line 84:
 
|| Type in '''Input bar''':
 
|| Type in '''Input bar''':
  
'''A= (2,4) '''>> Press '''Enter'''.
+
'''A= (2,4) ''' >> Press '''Enter'''.
  
  
Line 99: Line 100:
 
|| Type in the '''input bar:'''  
 
|| Type in the '''input bar:'''  
  
{{anchor|DdeLink33002374591931}} '''SetCoords(A, x(A)+1, y(A)-1)'''
+
 
 +
'''SetCoords(A, x(A)+1, y(A)-1)'''
  
  
 
Point to the code in the''' Input bar.'''
 
Point to the code in the''' Input bar.'''
|| In the''' input bar '''type''' '''the following command.
+
|| In the''' input bar '''type the following command.
  
 
This code moves the '''x '''coordinate of '''A '''by one up and '''y''' coordinate by one down.
 
This code moves the '''x '''coordinate of '''A '''by one up and '''y''' coordinate by one down.
  
  
Press '''Enter''' to execute the command.
+
Press '''Enter''' to execute the '''command'''.
 
|-
 
|-
 
|| Point to '''A(3,3)'''
 
|| Point to '''A(3,3)'''
Line 114: Line 116:
  
 
|-
 
|-
|| In the '''Input bar''' click the up, down arrow keys >> select the command from the list.
+
|| In the '''Input bar''' click the up, down arrow keys >>  
 +
 
 +
select the command from the list.
  
  
 
Cursor near point '''A '''in the '''Graphics view'''.
 
Cursor near point '''A '''in the '''Graphics view'''.
|| Let us execute the same command once again.
+
|| Let us execute the same '''command''' once again.
 +
 
  
  
Line 124: Line 129:
  
 
|-
 
|-
|| Type in the '''input bar''' >> '''Circle'''('''A''', '''3''') >> press '''Enter'''.
+
|| Type in the '''input bar''' >>  
 +
 
 +
'''Circle'''('''A''', '''3''') >>  
 +
 
 +
Press '''Enter'''.
  
  
Line 134: Line 143:
  
  
Type this command in the''' input bar '''and press '''Enter'''.
+
Type this '''command''' in the''' input bar '''and press '''Enter'''.
  
  
Line 147: Line 156:
  
 
|-
 
|-
|| Type in input bar
+
|| Type in input bar:
  
{{anchor|DdeLink33022374591931}} '''SetDynamicColor[c, Red, Green, Blue]''' >> Press '''Enter'''.
+
'''SetDynamicColor[c, Red, Green, Blue]''' >>
 +
 
 +
Press '''Enter'''.
  
  
 
Point to the dialog box.
 
Point to the dialog box.
|| Type this command in the''' input bar '''and press '''Enter'''.
+
|| Type this '''command''' in the''' input bar '''and press '''Enter'''.
  
  
Line 170: Line 181:
 
|| Drag '''sliders Red''', '''Blue ''' and '''Green''' back and forth.
 
|| Drag '''sliders Red''', '''Blue ''' and '''Green''' back and forth.
 
|| Now drag the '''sliders''' to see the circle in various combinations of colours.
 
|| Now drag the '''sliders''' to see the circle in various combinations of colours.
 
  
 
|-
 
|-
Line 189: Line 199:
 
|-
 
|-
 
|| Type in input bar:
 
|| Type in input bar:
 +
  
 
'''r=RandomBetween[0,5]'''
 
'''r=RandomBetween[0,5]'''
Line 194: Line 205:
  
 
Point to '''r '''value in the '''Algebra view'''.
 
Point to '''r '''value in the '''Algebra view'''.
|| Now let’s create radius '''r''' of circle''' c '''randomly using this command.  
+
|| Now let’s create radius '''r''' of circle''' c '''randomly using this '''command'''.  
  
  
 
|-
 
|-
 
|| Type in input bar:
 
|| Type in input bar:
 +
  
 
'''c= Circle[B,r]'''
 
'''c= Circle[B,r]'''
Line 206: Line 218:
  
  
|| To get a random circle '''c''', type this command.
+
|| To get a random circle '''c''', type this '''command'''.
  
  
Line 224: Line 236:
  
 
|-
 
|-
|| Press '''Ctrl''' and '''A ''' keys to select and '''Delete''' Key to delete.
+
|| Press '''Ctrl''' and '''A ''' keys to select and
 +
 
 +
Press '''Delete''' Key to delete.
 
|| Let us select all the objects and delete them.
 
|| Let us select all the objects and delete them.
  
Line 242: Line 256:
  
  
Type the following command and press '''Enter'''.  
+
Type the following '''command''' and press '''Enter'''.  
  
  
Line 248: Line 262:
 
|| Point to point '''A'''.
 
|| Point to point '''A'''.
 
|| Point '''A''' will be the vertex of the parabola.
 
|| Point '''A''' will be the vertex of the parabola.
 
  
 
|-
 
|-
Line 255: Line 268:
  
 
Observe that the coordinates of point '''A''' keep changing.  
 
Observe that the coordinates of point '''A''' keep changing.  
 
  
 
|-
 
|-
Line 268: Line 280:
  
 
Here '''x(A) '''and '''y(A)''' are the coordinates of point '''A''' in the equation.  
 
Here '''x(A) '''and '''y(A)''' are the coordinates of point '''A''' in the equation.  
 
  
 
|-
 
|-
 
|| Point to the parabola.
 
|| Point to the parabola.
 
|| Observe that, parabola opens upwards.
 
|| Observe that, parabola opens upwards.
 
  
 
|-
 
|-
 
|| Point to the parabola.  
 
|| Point to the parabola.  
 
|| To make the parabola open downwards, we need to randomly generate +1 and -1.  
 
|| To make the parabola open downwards, we need to randomly generate +1 and -1.  
 
  
 
|-
 
|-
Line 294: Line 303:
  
 
Point to the values of '''a''' and '''n''' in the '''Algebra view'''.
 
Point to the values of '''a''' and '''n''' in the '''Algebra view'''.
|| Type the following command and press '''Enter'''.
+
|| Type the following '''command''' and press '''Enter'''.
  
  
Line 300: Line 309:
  
  
Type the following command.  
+
Type the following '''command'''.  
  
 
Here '''a''' changes when '''n''' is equal to 1.
 
Here '''a''' changes when '''n''' is equal to 1.
Line 306: Line 315:
  
 
We can see the values of '''n '''and '''a '''only in the '''Algebra view'''.
 
We can see the values of '''n '''and '''a '''only in the '''Algebra view'''.
 
  
 
|-
 
|-
Line 319: Line 327:
  
  
Type''' a *''' before the function.
+
Type''' a *''' before the '''function'''.
 +
 
  
 
'''a * (x + x(A))² + y(A)'''
 
'''a * (x + x(A))² + y(A)'''
Line 325: Line 334:
  
 
Point to the parabola.
 
Point to the parabola.
|| Double-click on the function '''f(x) '''in the '''Algebra View'''.
+
|| Double-click on the '''function f(x) '''in the '''Algebra View'''.
  
  
Line 331: Line 340:
  
  
Type '''a '''space asterisk(*) before the function and click '''OK''' button.
+
Type '''a '''space asterisk(*) before the '''function''' and click '''OK''' button.
  
  
Line 341: Line 350:
 
|-
 
|-
 
|| Only Narration.
 
|| Only Narration.
|| Now we will see how to use '''IF '''commands to generate various functions.
+
|| Now we will see how to use '''IF commands''' to generate various '''functions'''.
  
 
|-
 
|-
Line 351: Line 360:
 
|-
 
|-
 
|| Type '''IF''' in the input bar to show the list of''' IF''' commands.
 
|| Type '''IF''' in the input bar to show the list of''' IF''' commands.
|| In general, the '''IF''' command is '''IF[Condition, Then, Else]'''
+
|| In general, the '''IF command''' is '''IF[Condition, Then, Else]'''
 
|-
 
|-
 
|| Select the''' Slider''' tool(tool is shown as '''a=2''').
 
|| Select the''' Slider''' tool(tool is shown as '''a=2''').
Line 375: Line 384:
 
|-
 
|-
 
|| Cursor on the '''Graphics view'''.
 
|| Cursor on the '''Graphics view'''.
|| Let us draw circles of two different radii using the '''IF''' command.  
+
|| Let us draw circles of two different radii using the '''IF command'''.  
  
  
Line 381: Line 390:
 
|| Type in the input bar:
 
|| Type in the input bar:
  
'''IF[n<3, Circle[(0,0),1], circle[(2,0),4]]''' >> press '''Enter'''.
+
 
 +
'''IF[n<3, Circle[(0,0),1], circle[(2,0),4]]''' >>  
 +
 
 +
Press '''Enter'''.
  
  
 
Point to the circle.
 
Point to the circle.
|| Type the following command and press '''Enter.'''
+
|| Type the following '''command''' and press '''Enter.'''
  
  
Line 399: Line 411:
  
 
A new circle with center at (2,0) and radius 4 centimetres is drawn.
 
A new circle with center at (2,0) and radius 4 centimetres is drawn.
 
  
 
|-
 
|-
Line 411: Line 422:
 
|| In the '''Algebra View '''
 
|| In the '''Algebra View '''
  
C{{anchor|DdeLink36532885422962}} lick to select '''c''' >> press '''Delete''' key on the keyboard.  
+
Click to select '''c''' >>  
 +
 
 +
Press '''Delete''' key on the keyboard.  
  
 
'''or'''
 
'''or'''
  
Click to select '''c '''>> and Right-click on it >> select '''Delete''' option.
+
Click to select '''c ''' >> and  
 +
 
 +
Right-click on it >> select '''Delete''' option.
 
||Now let’s delete circle '''c'''.
 
||Now let’s delete circle '''c'''.
 
|-
 
|-
 
|| Only Narration.
 
|| Only Narration.
|| Next let us draw a segment and a circle in the same manner using the '''IF''' command.
+
|| Next let us draw a segment and a circle in the same manner using the '''IF command'''.
  
  
Line 429: Line 444:
 
|| Type in the input bar:
 
|| Type in the input bar:
  
'''IF[n>2,Circle[(0,0),2], Segment((2,2), 3)]''' >> press '''Enter'''.
+
 
 +
'''IF[n>2,Circle[(0,0),2], Segment((2,2), 3)]''' >>  
 +
 
 +
Press '''Enter'''.
  
  
 
Point to the segment.
 
Point to the segment.
|| Type the following command and press '''Enter'''.
+
|| Type the following '''command''' and press '''Enter'''.
  
  
Line 464: Line 482:
 
|| In the '''Algebra View'''  
 
|| In the '''Algebra View'''  
  
click to select '''c''' >> press the '''Delete''' key on the keyboard.
+
Click to select '''c''' >>  
 +
 
 +
Press the '''Delete''' key on the keyboard.
 
|| Again let’s delete the circle '''c '''and retain the''' slider n'''.
 
|| Again let’s delete the circle '''c '''and retain the''' slider n'''.
  
Line 473: Line 493:
 
|-
 
|-
 
|| Only Narration.
 
|| Only Narration.
|| Now we will use the''' IF''' command to show '''trigonometric '''functions.  
+
|| Now we will use the''' IF command''' to show '''trigonometric functions'''.  
 
|-
 
|-
|| Type in the input bar.
+
|| Type in the input bar:
 +
 
  
 
'''IF[n>2, sin(90-x),cos(x)] '''>> press '''Enter'''.
 
'''IF[n>2, sin(90-x),cos(x)] '''>> press '''Enter'''.
  
  
Point to the fuction in the '''Algebra view '''and '''Graphics view'''.
+
Point to the function in the '''Algebra view '''and '''Graphics view'''.
|| Type the following command and press '''Enter'''.
+
|| Type the following '''command''' and press '''Enter'''.
  
  
A '''cos(x) '''function is plotted.
+
A '''cos(x) function''' is plotted.
  
 
|-
 
|-
Line 490: Line 511:
  
  
Point to the fuction in the '''Algebra view '''and '''Graphics view'''.
+
Point to the '''function''' in the '''Algebra view '''and '''Graphics view'''.
 
|| As we drag the '''slider '''from '''n'''<nowiki>=0 to </nowiki>'''n'''<nowiki>=5,</nowiki>
 
|| As we drag the '''slider '''from '''n'''<nowiki>=0 to </nowiki>'''n'''<nowiki>=5,</nowiki>
  
function change point at algebra views from '''cos(x)''' to '''sin(90-x)'''.
+
function changes from '''cos(x)''' to '''sin(90-x)'''.
  
 
|-
 
|-
 
|| In the '''Algebra View '''
 
|| In the '''Algebra View '''
  
Click to select function >> press '''Delete '''key on the keyboard.
+
Click to select '''function''' >> Press '''Delete '''key on the keyboard.
|| Let’s delete the function.
+
|| Let’s delete the '''function'''.
 
|-
 
|-
 
|| Type in the input bar:
 
|| Type in the input bar:
  
 
'''IF[n>2, sin(90-x),tan(x)]'''
 
'''IF[n>2, sin(90-x),tan(x)]'''
|| Similarly let us plot''' tan(x)''' and '''sin(90-x)''' functions.
+
|| Similarly let us plot''' tan(x)''' and '''sin(90-x) functions'''.
  
 
|-
 
|-
Line 510: Line 531:
  
  
Point to the function in the '''Algebra view '''and '''Graphics view'''.
+
Point to the '''function''' in the '''Algebra view '''and '''Graphics view'''.
 
|| As we drag the '''slider''' from n=0 to '''n'''<nowiki>=5,</nowiki>
 
|| As we drag the '''slider''' from n=0 to '''n'''<nowiki>=5,</nowiki>
  
function changes from '''tan(x)''' to '''sin(90-x)'''.
+
'''function''' changes from '''tan(x)''' to '''sin(90-x)'''.
 
+
  
 
|-
 
|-
|| '''Slide'''
+
|| '''Slide Number 6'''
  
 
'''Assignment'''
 
'''Assignment'''
Line 528: Line 548:
 
* Draw triangles of different sizes.
 
* Draw triangles of different sizes.
  
* Plot '''sin(x)''' and '''sinh(x)''' functions.
+
* Plot '''sin(x)''' and '''sinh(x) functions'''.
  
* Plot '''cot(x)''' and '''cos(x)''' functions.
+
* Plot '''cot(x)''' and '''cos(x) functions'''.
  
* Plot '''sin(90-x)''' and '''sinIntegral(x) ''' functions.
+
* Plot '''sin(90-x)''' and '''sinIntegral(x) functions'''.
  
 
|-
 
|-
Line 595: Line 615:
 
|| Click the '''Generate PGF/TikZ code''' button in the window.
 
|| Click the '''Generate PGF/TikZ code''' button in the window.
 
|| Now click the '''Generate PGF/TikZ code''' button in the window.
 
|| Now click the '''Generate PGF/TikZ code''' button in the window.
 
  
 
|-
 
|-
Line 630: Line 649:
 
Select '''Desktop''' to save the file.
 
Select '''Desktop''' to save the file.
  
Type the name as '''Triangle''' >> Click on '''Save'''.
+
Type the name as '''Triangle''' >>  
 +
 
 +
Click on '''Save'''.
 
|| To save the file click on '''File''' and select '''Save'''.
 
|| To save the file click on '''File''' and select '''Save'''.
  
Line 637: Line 658:
 
I will save the file on my '''Desktop.'''
 
I will save the file on my '''Desktop.'''
  
Type the file name as '''Triangle '''and  
+
Type the file name as '''Triangle '''and click on '''Save'''.
 
+
click on '''Save'''.
+
  
 
|-
 
|-
 
|| Point to the file name.
 
|| Point to the file name.
 
|| File is saved as '''Triangle.tex'''.
 
|| File is saved as '''Triangle.tex'''.
 
 
  
 
|-
 
|-
 
|| Click the green '''Typeset '''button.
 
|| Click the green '''Typeset '''button.
|| Now l! Package pgfkeys Error: Choice '1.15' unknown in choice key '/pgfplots/compat/
+
|| Now let's run the file.
 
+
anchors'. I am going to ignore this key.
+
 
+
 
+
See the pgfkeys package documentation for explanation.
+
 
+
Type H <return> for immediate help.et’s run the file.
+
  
 
Click the green '''Typeset''' button to run the code.
 
Click the green '''Typeset''' button to run the code.
 
 
  
 
|-
 
|-
 
|| Point to the generated pdf file.
 
|| Point to the generated pdf file.
|| The pdf file of the drawn figure is generated.
+
|| The '''pdf''' file of the drawn figure is generated.
 
+
  
 
|-
 
|-
Line 695: Line 702:
 
|| Click on '''Format '''drop down >> Select '''LaTeX(beamer class)''' option.
 
|| Click on '''Format '''drop down >> Select '''LaTeX(beamer class)''' option.
 
|| In the '''Format''' drop-down let us select '''LaTeX(beamer class)''' option.
 
|| In the '''Format''' drop-down let us select '''LaTeX(beamer class)''' option.
 
  
 
|-
 
|-
 
|| Click the '''Generate PGF/TikZ code''' button.
 
|| Click the '''Generate PGF/TikZ code''' button.
 
|| Click the '''Generate PGF/TikZ code''' button.
 
|| Click the '''Generate PGF/TikZ code''' button.
 
  
 
|-
 
|-
 
|| Point to the generated code.
 
|| Point to the generated code.
 
|| The generated code is seen in the text box below.
 
|| The generated code is seen in the text box below.
 
  
 
|-
 
|-
Line 716: Line 720:
 
|| Point to the new '''Texworks''' file.
 
|| Point to the new '''Texworks''' file.
 
|| I have opened a new '''Texworks''' file.
 
|| I have opened a new '''Texworks''' file.
 
  
 
|-
 
|-
 
|| Press '''Ctrl + V''' keys to paste the code.
 
|| Press '''Ctrl + V''' keys to paste the code.
 
|| Now paste the copied code in the window.
 
|| Now paste the copied code in the window.
 
  
 
|-
 
|-
Line 742: Line 744:
  
 
Click the green '''Typeset''' button to run the code.
 
Click the green '''Typeset''' button to run the code.
 
  
 
|-
 
|-
 
|| Point to the generated '''pdf''' file.
 
|| Point to the generated '''pdf''' file.
 
|| A '''pdf''' file is generated with a number of pages.
 
|| A '''pdf''' file is generated with a number of pages.
 
  
 
|-
 
|-
 
|| Scroll through the pages to see the construction in a step by step process.
 
|| Scroll through the pages to see the construction in a step by step process.
 
|| '''Pdf '''file shows the step by step construction of the drawn figure on each page.
 
|| '''Pdf '''file shows the step by step construction of the drawn figure on each page.
 
  
 
|-
 
|-
Line 760: Line 759:
 
Let us summarise.  
 
Let us summarise.  
 
|-
 
|-
|| '''Slide '''
+
|| '''Slide Number 7 '''
  
 
'''Summary'''.
 
'''Summary'''.
 
|| In this tutorial we have learnt to,
 
|| In this tutorial we have learnt to,
  
* Use various script commands to draw and manipulate objects.
+
* Use various '''script commands''' to draw and manipulate objects.
  
 
* Use '''IF''' commands to draw objects.
 
* Use '''IF''' commands to draw objects.
Line 772: Line 771:
  
 
* Run the '''LaTeX''' code to show the output in pdf format.
 
* Run the '''LaTeX''' code to show the output in pdf format.
 
  
 
|-
 
|-
|| '''Slide '''
+
|| '''Slide Number 8 '''
  
 
'''Assignment'''
 
'''Assignment'''
 
|| Here is an assignment for you.
 
|| Here is an assignment for you.
  
 
+
* Plot '''sin(x)''', '''cos(x)''' and '''tan(x) functions''' in the same''' GeoGebra ''' file.
* Plot '''sin(x)''', '''cos(x)''' and '''tan(x)''' functions in the same''' GeoGebra ''' file.
+
  
 
* Using the '''GeoGebra''' file generate a '''LaTeX''' code for '''article class'''.
 
* Using the '''GeoGebra''' file generate a '''LaTeX''' code for '''article class'''.
  
 
* Run the '''LaTeX '''code to generate a pdf file.
 
* Run the '''LaTeX '''code to generate a pdf file.
 
 
  
 
|-
 
|-
 
|| Glimpse of assignment
 
|| Glimpse of assignment
 
|| Your completed assignment should look as follows.
 
|| Your completed assignment should look as follows.
 
 
  
 
|-
 
|-
|| '''Slide '''
+
|| '''Slide Number 9 '''
  
 
'''Assignment'''
 
'''Assignment'''
 
|| Here is another assignment for you.
 
|| Here is another assignment for you.
 
  
 
* Open a new '''GeoGebra''' window.
 
* Open a new '''GeoGebra''' window.
Line 806: Line 798:
 
* Draw a circumscribed circle in it.
 
* Draw a circumscribed circle in it.
  
* Generate a''' LaTeX '''code for '''beamer''' '''class'''.
+
* Generate a''' LaTeX '''code for '''beamer class'''.
  
 
* Run the '''LaTeX''' code to generate a pdf file.
 
* Run the '''LaTeX''' code to generate a pdf file.
 
 
  
 
|-
 
|-
 
|| Glimpse of assignment
 
|| Glimpse of assignment
 
|| Your completed assignment should look as follows.
 
|| Your completed assignment should look as follows.
 
 
  
 
|-
 
|-
|| '''Slide Number 9'''
+
|| '''Slide Number 10'''
  
 
'''About Spoken Tutorial Project'''
 
'''About Spoken Tutorial Project'''
Line 825: Line 813:
 
* The video at the following link summarises the Spoken Tutorial project.
 
* The video at the following link summarises the Spoken Tutorial project.
 
* Please download and watch it.
 
* Please download and watch it.
 
 
 
  
 
|-
 
|-
|| '''Slide Number 10'''
+
|| '''Slide Number 11'''
  
 
'''Spoken tutorial workshops'''
 
'''Spoken tutorial workshops'''
Line 838: Line 823:
  
 
|-
 
|-
|| '''Slide''' '''Number 11'''
+
|| '''Slide Number 12'''
  
 
'''Forums'''
 
'''Forums'''
 
|| Please post your timed queries in this forum.
 
|| Please post your timed queries in this forum.
 
 
  
 
|-
 
|-
|| '''Slide Number 12'''
+
|| '''Slide Number 13'''
  
 
'''Acknowledgment'''
 
'''Acknowledgment'''
 
 
 
|| The '''Spoken Tutorial''' project is funded by the '''Ministry of Education '''Govt. of India.
 
|| The '''Spoken Tutorial''' project is funded by the '''Ministry of Education '''Govt. of India.
  

Latest revision as of 14:50, 2 December 2022

Keywords: GeoGebra, scripting, latex, input bar, Texworks, if commands, circle, parabola, spoken tutorial, video tutorial.


Visual Cue Narration
Slide Number 1

Title Slide

Welcome to this Spoken Tutorial on Scripting and LaTeX in GeoGebra.
Slide Number 2

Learning Objectives

In this tutorial we will learn to,
  • Use various script commands to draw and manipulate objects.
  • Use IF commands to draw objects.
  • Convert GeoGebra file to a LaTeX file.
  • Run the LaTeX code to show the output in pdf format.
Slide Number 3

System Requirement

To record this tutorial, I am using;
  • Ubuntu Linux OS version 18.04
  • GeoGebra version 5.0660.0-d
  • TeXworks version 0.6.3

The commands shown in this tutorial will work in all 5.0x versions of GeoGebra.

Slide Number 4

Pre-requisites

https://spoken-tutorial.org

To practise this tutorial,

You should have full version of TeXworks installed on your system.

You should be familiar with GeoGebra and LaTeX.


For the prerequisite GeoGebra and LaTeX tutorials please visit this website.

Slide Number 5

Code Files

The files used in this tutorial are provided in the Code files link.

Please download and extract the files.

Make a copy and use them for practising.

Cursor on the GeoGebra window. I have opened a new GeoGebra window.
Only Narration.


Open and show the scripting-commands.txt file.

Let us begin with scripting in GeoGebra.


The commands used in this tutorial are available in scripting-commands.txt file.


This file is given in the Codes Files for the learners to use.

For beginners the Input bar is at the bottom.

Shown as Input:

In this tutorial we will use the Input bar to draw various objects.
Type in Input bar:

A= (2,4) >> Press Enter.


Cursor near Point A.

In the Input bar type A= (2, 4) and press Enter.


Point A is marked in the Graphics view at (2,4).

Cursor near point A. Now we will use script commands to change the coordinates of point A.
Type in the input bar:


SetCoords(A, x(A)+1, y(A)-1)


Point to the code in the Input bar.

In the input bar type the following command.

This code moves the x coordinate of A by one up and y coordinate by one down.


Press Enter to execute the command.

Point to A(3,3) The coordinates of point A now are (3,3).
In the Input bar click the up, down arrow keys >>

select the command from the list.


Cursor near point A in the Graphics view.

Let us execute the same command once again.


The coordinates of point A change to (4,2).

Type in the input bar >>

Circle(A, 3) >>

Press Enter.


Point to circle c.


Drag the Algebra view boundary.

Now let us draw a circle using point A.


Type this command in the input bar and press Enter.


A circle with centre A and radius 3 cm is drawn.


Drag the boundary to see the equation clearly.

Point to the circle c. Let’s now change the colour of circle c dynamically.
Type in input bar:

SetDynamicColor[c, Red, Green, Blue] >>

Press Enter.


Point to the dialog box.

Type this command in the input bar and press Enter.


Create Sliders dialog box appears.

Click the Create Sliders button.

Point to the sliders.

Click the Create Sliders button.


Three sliders Red, Green, and Blue are created.

Drag sliders Red, Blue and Green back and forth. Now drag the sliders to see the circle in various combinations of colours.
Point to c. Now let’s create a random circle using a random point B.
Create a random point B, type in the input bar:


B= (RandomBetween[-2, 2], RandomBetween[-2, 2])

Point to Point B.

In the Input bar type the following command and press Enter.

Point B is drawn.

Type in input bar:


r=RandomBetween[0,5]


Point to r value in the Algebra view.

Now let’s create radius r of circle c randomly using this command.


Type in input bar:


c= Circle[B,r]


Drag the sliders Red, Blue and Green.


To get a random circle c, type this command.


Drag the sliders to see the circle in different colours.


Press Ctrl + R to move the circle randomly in the Graphics view.


Point to the circle.

Press Ctrl and R keys to move the circle randomly in the Graphics view.


Notice the change in the radius of the circle as it moves.


Press Ctrl and A keys to select and

Press Delete Key to delete.

Let us select all the objects and delete them.


Only Narration. Next let's create a randomly generated parabola.


Type in the input bar:

A = (RandomBetween[-3,3],RandomBetween[-3,3])

Press Enter.

To create a random parabola let’s create a random point A.


Type the following command and press Enter.


Point to point A. Point A will be the vertex of the parabola.
Press Ctrl and R keys repeatedly. Press Ctrl and R keys repeatedly.

Observe that the coordinates of point A keep changing.

In the Input bar type:

f(x) = ( x + x(A) )^2 + y(A) and press Enter.


Point to x(A) and y(A) in the input bar.

In the Input bar type the following command.


Here x(A) and y(A) are the coordinates of point A in the equation.

Point to the parabola. Observe that, parabola opens upwards.
Point to the parabola. To make the parabola open downwards, we need to randomly generate +1 and -1.
In the input bar type:

n = RandomBetween[ 0 , 1 ] >> press Enter

Point to n value in the Algebra view.


Type:

a = If[ n == 1 , 1 , -1 ] >> Press Enter.


Point to the values of a and n in the Algebra view.

Type the following command and press Enter.


Here n is a number which is in between 0 and 1.


Type the following command.

Here a changes when n is equal to 1.


We can see the values of n and a only in the Algebra view.

press Ctrl + R keys repeatedly. Keep pressing Ctrl and R keys repeatedly.


Observe the changes in point A, a and n values and the parabola.

Double-click the function f(x) in the Algebra View.


Type a * before the function.


a * (x + x(A))² + y(A)


Point to the parabola.

Double-click on the function f(x) in the Algebra View.


Redefine text box appears.


Type a space asterisk(*) before the function and click OK button.


Observe that the parabola has opened downwards.

Press Ctrl and R keys repeatedly. Press Ctrl and R keys repeatedly to see the changes in the parabola.
Only Narration. Now we will see how to use IF commands to generate various functions.
Click on File >> New Window. For this we will open a new GeoGebra window.


Type IF in the input bar to show the list of IF commands. In general, the IF command is IF[Condition, Then, Else]
Select the Slider tool(tool is shown as a=2).

Click in the Graphics View.

In the Slider dialog box

Change name to n.

Change the Min value to 0 and Max value to 5.

Click the OK button.


Let’s first create a number slider n with Min value 0 and Max value 5.
Select the Move tool(tool shown as arrow). Click the Move tool to avoid accidental clicking of unnecessary objects.


Cursor on the Graphics view. Let us draw circles of two different radii using the IF command.


Type in the input bar:


IF[n<3, Circle[(0,0),1], circle[(2,0),4]] >>

Press Enter.


Point to the circle.

Type the following command and press Enter.


A circle with center at the origin (0,0) and radius 1 cm is drawn.

Drag the slider from n=0 to n=3.


Point the circle.

Now drag the slider from n is equal to zero to n is equal to three.


A new circle with center at (2,0) and radius 4 centimetres is drawn.

Drag the slider n=0 to n=5.

Point to the circle with different radius.

As we drag the slider from n=0 to n=5 the radius changes from 1 cm to 4 centimetres.


In the Algebra View

Click to select c >>

Press Delete key on the keyboard.

or

Click to select c >> and

Right-click on it >> select Delete option.

Now let’s delete circle c.
Only Narration. Next let us draw a segment and a circle in the same manner using the IF command.


Drag the slider to n=0. Let us drag the slider back to n=0.
Type in the input bar:


IF[n>2,Circle[(0,0),2], Segment((2,2), 3)] >>

Press Enter.


Point to the segment.

Type the following command and press Enter.


A segment parallel to x axis and at a distance of 2 cm is drawn.


Drag the slider from n=0 to n>2.


Point to the circle.


Point to the circle in Algebra view.

Now drag the slider from n=0 to n greater than 2 (n>2).


A circle with center at (0,0) and radius 2 cm is drawn.


Users may change the values to draw the circle with different dimensions.

Drag the slider n=0 to n=5.

Point to the segment and circle.

As we drag the slider from n=0 to n=5 the segment changes to a circle.
In the Algebra View

Click to select c >>

Press the Delete key on the keyboard.

Again let’s delete the circle c and retain the slider n.
Drag the slider to n=0. Let us drag the slider back to n=0.
Only Narration. Now we will use the IF command to show trigonometric functions.
Type in the input bar:


IF[n>2, sin(90-x),cos(x)] >> press Enter.


Point to the function in the Algebra view and Graphics view.

Type the following command and press Enter.


A cos(x) function is plotted.

Drag the slider n=0 to n=5.


Point to the function in the Algebra view and Graphics view.

As we drag the slider from n=0 to n=5,

function changes from cos(x) to sin(90-x).

In the Algebra View

Click to select function >> Press Delete key on the keyboard.

Let’s delete the function.
Type in the input bar:

IF[n>2, sin(90-x),tan(x)]

Similarly let us plot tan(x) and sin(90-x) functions.
Drag the slider n=0 to n=5.


Point to the function in the Algebra view and Graphics view.

As we drag the slider from n=0 to n=5,

function changes from tan(x) to sin(90-x).

Slide Number 6

Assignment

Pause the tutorial and do this assignment.


Use IF command to:

  • Draw triangles of different sizes.
  • Plot sin(x) and sinh(x) functions.
  • Plot cot(x) and cos(x) functions.
  • Plot sin(90-x) and sinIntegral(x) functions.
Only Narration. Now we will learn how to generate LaTeX code for a GeoGebra file.
Point to the Code files on the Desktop. For this let us open the files provided in the Code files link.

I have downloaded and saved them on my Desktop.

Please download and save them to your convenient folder.

Point to the two GeoGebra files. The Code Files folder contains two GeoGebra files to generate the LaTeX code.


One for the article class and another for the beamer class.


Users may use the files as per their choice.

Point to Triangle.ggb file.


Double-click on the file to open in GeoGebra.

Let us first open the Triangle.ggb file in GeoGebra.


Double-click on the file to open in GeoGebra.

Click on File menu and select Export.


From the submenu select Graphics View as PGF/TIKZ.

Click the File menu and select Export.


From the submenu select Graphics View as PGF/TIKZ.

Point to the window. GeoGebra to PGF Export window opens.
Click the Format drop-down button.


Point to LaTeX(article class)

In the window, Format option has a drop-down arrow button.

By default LaTeX(article class) is selected.


We will leave the default selection as such.

Click the Generate PGF/TikZ code button in the window. Now click the Generate PGF/TikZ code button in the window.
Point to the generated code. Code is generated in the text box below.
Press Ctrl +A to select text.

Press Ctrl + C to copy text.


Point to Copy to Clipboard button.

Select the text and copy it.


You may also click the Copy to Clipboard button to copy the LaTeX code.

Open your Texworks tex file. I have opened a new Texworks file.


Users may open their default LaTeX file.

Press Ctrl + V keys to paste in the untitled TeXworks window. Now paste the copied code in the TeXworks window.
Click on File and select Save.


Point to the dialog box.

Select Desktop to save the file.

Type the name as Triangle >>

Click on Save.

To save the file click on File and select Save.

Save dialog box opens.

I will save the file on my Desktop.

Type the file name as Triangle and click on Save.

Point to the file name. File is saved as Triangle.tex.
Click the green Typeset button. Now let's run the file.

Click the green Typeset button to run the code.

Point to the generated pdf file. The pdf file of the drawn figure is generated.
Show the Code files folder.


Point to Arc-sector.ggb file.


Double click on Arc-sector.ggb file to open in GeoGebra.

Let us go back to the Code files folder.


This time let us open the Arc-sector.ggb file in GeoGebra.

Click the File menu and select Export.


From the submenu select Graphics View as PGF/TIKZ.

Click the File menu and select Export.


From the submenu select Graphics View as PGF/TIKZ.

Point to the window. GeoGebra to PGF Export window opens.
Click on Format drop down >> Select LaTeX(beamer class) option. In the Format drop-down let us select LaTeX(beamer class) option.
Click the Generate PGF/TikZ code button. Click the Generate PGF/TikZ code button.
Point to the generated code. The generated code is seen in the text box below.
Press Ctrl + A to select text.

Press Ctrl + C to copy text.

Select the text and copy it.
Point to the new Texworks file. I have opened a new Texworks file.
Press Ctrl + V keys to paste the code. Now paste the copied code in the window.
Click on File and select Save.

Select Desktop to save the file.

Type file name as Arc-sector >> Click on Save.

To save the file click on File and select Save.

In the Save dialog box, type the file name as Arc-sector and click on Save.

Point to the saved file. The file is saved as Arc-sector.tex.
Click the green Typeset button to run the code. Now let’s run the file.

Click the green Typeset button to run the code.

Point to the generated pdf file. A pdf file is generated with a number of pages.
Scroll through the pages to see the construction in a step by step process. Pdf file shows the step by step construction of the drawn figure on each page.
Only Narration. With this we come to the end of this tutorial.

Let us summarise.

Slide Number 7

Summary.

In this tutorial we have learnt to,
  • Use various script commands to draw and manipulate objects.
  • Use IF commands to draw objects.
  • Convert GeoGebra file to a LaTeX file.
  • Run the LaTeX code to show the output in pdf format.
Slide Number 8

Assignment

Here is an assignment for you.
  • Plot sin(x), cos(x) and tan(x) functions in the same GeoGebra file.
  • Using the GeoGebra file generate a LaTeX code for article class.
  • Run the LaTeX code to generate a pdf file.
Glimpse of assignment Your completed assignment should look as follows.
Slide Number 9

Assignment

Here is another assignment for you.
  • Open a new GeoGebra window.
  • Draw a circumscribed circle in it.
  • Generate a LaTeX code for beamer class.
  • Run the LaTeX code to generate a pdf file.
Glimpse of assignment Your completed assignment should look as follows.
Slide Number 10

About Spoken Tutorial Project

  • The video at the following link summarises the Spoken Tutorial project.
  • Please download and watch it.
Slide Number 11

Spoken tutorial workshops

  • We conduct workshops using Spoken Tutorials and give certificates.
  • For more details, please contact us.
Slide Number 12

Forums

Please post your timed queries in this forum.
Slide Number 13

Acknowledgment

The Spoken Tutorial project is funded by the Ministry of Education Govt. of India.
This is Madhuri Ganapathi from, IIT Bombay signing off.

Thank you for watching.

Contributors and Content Editors

Madhurig, Nancyvarkey