GeoGebra变量赋值与保存方法演示
2020-04-23 15:53
本范例详细介绍了在GeoGebra中保存和赋值变量的两种常用方法。通过按钮、文本以及变量和列表的交互构造,展示了如何利用按钮控件实现变量状态的动态保存与更新。该示例适合学习GeoGebra进阶交互设计与脚本编程,帮助教师和学生更好地管理数学模型中的动态参数。
<?xml version="1.0" encoding="utf-8"?>
<geogebra format="5.0" version="5.0.578.0" app="classic" platform="w" id="b5c6f9a6-d3ab-437d-b37a-eb77e509be98" xsi:noNamespaceSchemaLocation="https://ggb123.cn/apps/xsd/ggb.xsd" xmlns="" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >
<gui>
<window width="1346" height="1081" />
<perspectives>
<perspective id="tmp">
<panes>
<pane location="" divider="0.1961367013372957" orientation="1" />
<pane location="1" divider="0.5260029717682021" orientation="1" />
</panes>
<views>
<view id="1" visible="true" inframe="false" stylebar="true" location="1,3" size="708" window="383,174,600,400" />
<view id="4" toolbar="0 || 2020 , 2021 , 2022 , 66 || 2001 , 2003 , 2002 , 2004 , 2005 || 2040 , 2041 , 2042 , 2044 , 2043" visible="true" inframe="false" stylebar="true" location="1,1" size="357" window="100,100,600,400" />
<view id="8" toolbar="1001 | 1002 | 1003 || 1005 | 1004 || 1006 | 1007 | 1010 || 1008 1009 || 66 68 || 6" visible="false" inframe="false" stylebar="true" location="1,3" size="300" window="100,100,600,400" />
<view id="32" visible="false" inframe="false" stylebar="true" location="1,1" size="431" window="25,17,1316,704" />
<view id="2" visible="true" inframe="false" stylebar="true" location="3" size="264" window="100,100,250,400" />
<view id="16" visible="false" inframe="false" stylebar="false" location="1" size="150" window="50,50,500,500" />
<view id="64" toolbar="0" visible="false" inframe="false" stylebar="true" location="1" size="150" window="433,119,500,500" />
<view id="128" visible="false" inframe="false" stylebar="false" location="1" size="480" window="50,50,500,500" />
<view id="4097" visible="false" inframe="false" stylebar="true" location="1" size="288" window="-105,498,1177,514" />
<view id="70" toolbar="0 || 2020 || 2021 || 2022" visible="false" inframe="false" stylebar="true" location="1" size="150" window="50,50,500,500" />
<view id="43" visible="false" inframe="false" stylebar="false" location="1" size="450" window="50,50,500,500" />
<view id="512" toolbar="0 | 1 501 5 19 , 67 | 2 15 45 18 , 7 37 | 514 3 9 , 13 44 , 47 | 16 | 551 550 11 , 20 22 21 23 , 55 56 57 , 12 | 69 | 510 511 , 512 513 | 533 531 , 534 532 , 522 523 , 537 536 , 535 | 521 520 | 36 , 38 49 560 | 571 30 29 570 31 33 | 17 | 540 40 41 42 , 27 28 35 , 6 , 502 | 100006 100007" visible="false" inframe="false" stylebar="true" location="1" size="534" window="100,100,600,400" />
</views>
<toolbar show="false" items="0 39 73 62 | 1 501 67 , 5 19 , 72 75 76 | 2 15 45 , 18 65 , 7 37 | 4 3 8 9 , 13 44 , 58 , 47 | 16 51 64 , 70 | 10 34 53 11 , 24 20 22 , 21 23 | 55 56 57 , 12 | 36 46 , 38 49 50 , 71 14 68 | 30 29 54 32 31 33 | 25 17 26 60 52 61 | 40 41 42 , 27 28 35 , 6 | 100004 100002 100003 100005 100006 100007 100008 100009" position="1" help="false" />
<input show="false" cmd="true" top="false" />
<dockBar show="false" east="false" />
</perspective>
</perspectives>
<labelingStyle val="0"/>
<font size="16"/>
</gui>
<euclidianView>
<viewNumber viewNo="1"/>
<size width="707" height="1080"/>
<coordSystem xZero="167.84706767531952" yZero="343.7989953979154" scale="66.50031155592748" yscale="66.50031155592738"/>
<evSettings axes="false" grid="false" gridIsBold="false" pointCapturing="3" rightAngleStyle="1" checkboxSize="26" gridType="0"/>
<bgColor r="255" g="255" b="255"/>
<axesColor r="0" g="0" b="0"/>
<gridColor r="192" g="192" b="192"/>
<lineStyle axes="1" grid="0"/>
<axis id="0" show="false" label="" unitLabel="" tickStyle="1" showNumbers="true"/>
<axis id="1" show="false" label="" unitLabel="" tickStyle="1" showNumbers="true"/>
</euclidianView>
<spreadsheetView>
<size width="357" height="1081"/>
<prefCellSize width="70" height="22"/>
<spreadsheetColumn id="0" width="70"/>
<spreadsheetColumn id="1" width="70"/>
<spreadsheetColumn id="2" width="70"/>
<spreadsheetColumn id="3" width="70"/>
<spreadsheetColumn id="4" width="70"/>
<spreadsheetColumn id="5" width="70"/>
<spreadsheetColumn id="6" width="70"/>
<spreadsheetColumn id="7" width="70"/>
<spreadsheetColumn id="8" width="70"/>
<spreadsheetColumn id="9" width="70"/>
<selection hScroll="0" vScroll="0" column="-1" row="-1"/>
<layout showFormulaBar="true" showGrid="true" showHScrollBar="true" showVScrollBar="true" showColumnHeader="true" showRowHeader="true" allowToolTips="true"/>
</spreadsheetView>
<algebraView>
<mode val="1"/>
</algebraView>
<kernel>
<continuous val="false"/>
<usePathAndRegionParameters val="true"/>
<decimals val="2"/>
<angleUnit val="degree"/>
<algebraStyle val="0" spreadsheet="0"/>
<coordStyle val="0"/>
</kernel>
<tableview min="-2" max="2" step="1"/>
<scripting blocked="true" disabled="false"/>
<construction title="" author="" date="">
<element type="numeric" label="n">
<value val="1"/>
<show object="true" label="true"/>
<objColor r="0" g="0" b="0" alpha="0.10000000149011612"/>
<layer val="0"/>
<labelMode val="1"/>
<slider min="1" max="10" absoluteScreenLocation="true" width="200" x="221" y="230" fixed="false" horizontal="true" showAlgebra="true"/>
<lineStyle thickness="10" type="0" typeHidden="1"/>
<animation step="1" speed="1" type="1" playing="false"/>
</element>
<element type="numeric" label="a">
<value val="0"/>
<show object="true" label="true"/>
<objColor r="0" g="0" b="0" alpha="0.10000000149011612"/>
<layer val="0"/>
<labelMode val="1"/>
<slider min="0" max="100" absoluteScreenLocation="true" width="200" x="233" y="158" fixed="false" horizontal="true" showAlgebra="true"/>
<lineStyle thickness="10" type="0" typeHidden="1"/>
<animation step="1" speed="1" type="1" playing="false"/>
</element>
<element type="button" label="button1">
<show object="true" label="true"/>
<objColor r="0" g="0" b="0" alpha="1"/>
<bgColor r="0" g="255" b="0" alpha="255"/>
<layer val="0"/>
<labelOffset x="268" y="299"/>
<labelMode val="0"/>
<fixed val="true"/>
<auxiliary val="true"/>
<ggbscript val="Execute(l1)
if(n<10,SetValue(n,n+1),SetValue(n,1))"/>
<font serif="false" sizeM="2" size="16" style="0"/>
<caption val="记录"/>
</element>
<element type="button" label="button3">
<show object="true" label="true"/>
<objColor r="0" g="0" b="0" alpha="1"/>
<bgColor r="255" g="127" b="0" alpha="255"/>
<layer val="0"/>
<labelOffset x="124" y="302"/>
<labelMode val="0"/>
<fixed val="true"/>
<auxiliary val="true"/>
<ggbscript val="StartAnimation(a,true)"/>
<font serif="false" sizeM="2" size="16" style="0"/>
<caption val="开始"/>
</element>
<expression label="l1" exp="{"SetValue(A" + n + ",a)"}" />
<element type="list" label="l1">
<show object="false" label="true" ev="4"/>
<objColor r="0" g="100" b="0" alpha="0"/>
<layer val="0"/>
<labelMode val="0"/>
<lineStyle thickness="5" type="0" typeHidden="1"/>
<pointSize val="5"/>
<angleStyle val="0"/>
<symbolic val="true" />
</element>
<element type="button" label="button2">
<show object="true" label="true"/>
<objColor r="0" g="0" b="0" alpha="0"/>
<bgColor r="127" g="0" b="255" alpha="255"/>
<layer val="0"/>
<labelOffset x="397" y="299"/>
<labelMode val="0"/>
<fixed val="true"/>
<auxiliary val="true"/>
<ggbscript val="StartAnimation(a,false)
SetValue(a,0)
SetValue(n,1)"/>
<font serif="false" sizeM="2" size="16" style="0"/>
<caption val="复位"/>
</element>
<expression label="text1" exp=""作者:\ 肖建伟\ \ 2020/4/22\\
QQ:\ 1396787392""/>
<element type="text" label="text1">
<show object="true" label="false" ev="40"/>
<objColor r="0" g="0" b="0" alpha="0"/>
<bgColor r="191" g="255" b="0" alpha="255"/>
<layer val="0"/>
<labelMode val="0"/>
<isLaTeX val="true"/>
<font serif="true" sizeM="1" size="0" style="0"/>
<startPoint x="-1.4563400593073916" y="-1.055649258771441" z="1"/>
</element>
</construction>
</geogebra>