函数作图工具:列表描点法
2014-08-30 07:41
本范例展示了一个基于列表描点法的函数作图工具。用户可通过输入框输入数据,利用Take、Min、Max等命令处理列表数据,并在坐标系中动态绘制函数图像。工具支持拖动连线、集合操作及文本显示,帮助直观理解函数图像生成过程及分段函数等复杂函数的绘制方法。
所属专题
初中函数
GeoGebra 画板及绘图内容加载中,请稍等……
<?xml version="1.0" encoding="utf-8"?>
<geogebra format="5.0" version="5.0.588.0" app="classic" platform="w" id="7defd7c8-6eef-4217-bd81-331eb4982de0" xsi:noNamespaceSchemaLocation="http://www.geogebra.org/apps/xsd/ggb.xsd" xmlns="" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >
<gui>
<window width="1368" height="767" />
<perspectives>
<perspective id="tmp">
<panes>
<pane location="" divider="0.6030701754385965" orientation="1" />
<pane location="0" divider="0.2777777777777778" orientation="1" />
</panes>
<views>
<view id="4097" visible="false" inframe="false" stylebar="true" location="1,1,1,1" size="400" window="373,43,700,550" />
<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 , 22 , 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" visible="false" inframe="false" stylebar="false" location="1,1,1" size="500" window="100,100,600,400" />
<view id="1" visible="true" inframe="false" stylebar="false" location="3,1" size="437" window="100,100,600,400" />
<view id="4" toolbar="0 || 2020 , 2021 , 2022 , 66 || 2001 , 2003 , 2002 , 2004 , 2005 || 2040 , 2041 , 2042 , 2044 , 2043" visible="false" inframe="false" stylebar="false" location="1,1" size="300" window="100,100,600,400" />
<view id="2" visible="true" inframe="false" stylebar="false" location="3,3" size="380" window="100,100,250,400" />
<view id="8" toolbar="1001 | 1002 | 1003 || 1005 | 1004 || 1006 | 1007 | 1010 || 1008 1009 || 66 68 || 6" visible="false" inframe="false" stylebar="false" location="1,3" size="300" window="100,100,600,400" />
<view id="16" visible="true" inframe="false" stylebar="false" location="1" size="535" window="50,50,500,500" />
<view id="32" visible="false" inframe="false" stylebar="true" 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="50,50,500,500" />
<view id="128" visible="false" inframe="false" stylebar="false" location="1" size="480" window="50,50,500,500" />
<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" />
</views>
<toolbar show="true" items="0 39 | 1 501 67 , 5 19 , 72 | 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 | 30 29 54 32 31 33 | 17 26 62 73 , 14 66 68 | 25 52 60 61 | 40 41 42 , 27 28 35 , 6" position="1" help="false" />
<input show="true" cmd="true" top="algebra" />
<dockBar show="false" east="false" />
</perspective>
</perspectives>
<labelingStyle val="0"/>
<font size="12"/>
</gui>
<euclidianView>
<viewNumber viewNo="1"/>
<size width="437" height="714"/>
<coordSystem xZero="490.9103152530451" yZero="307.5084352161739" scale="35.00443958745985" yscale="35.00443958745987"/>
<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="10"/>
<axis id="0" show="false" label="" unitLabel="" tickStyle="1" showNumbers="true"/>
<axis id="1" show="false" label="" unitLabel="" tickStyle="1" showNumbers="true"/>
</euclidianView>
<euclidianView>
<viewNumber viewNo="2"/>
<size width="535" height="714"/>
<coordSystem xZero="391.34950589908726" yZero="349.00767461825444" scale="24.12659535448776" yscale="24.12659535448773"/>
<evSettings axes="true" 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="10"/>
<axis id="0" show="true" label="" unitLabel="" tickStyle="1" showNumbers="true"/>
<axis id="1" show="true" label="" unitLabel="" tickStyle="1" showNumbers="true"/>
</euclidianView>
<algebraView>
<mode val="1"/>
<collapsed val="4"/>
</algebraView>
<kernel>
<uses3D val="true"/>
<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="false" disabled="false"/>
<construction title="函数作图工具" author="" date="">
<worksheetText above="输入x,点击"列表描点"按钮,拖动连线滑竿." below=""/>
<element type="numeric" label="拖动连线">
<value val="1.5"/>
<show object="true" label="true" ev="3"/>
<objColor r="0" g="0" b="0" alpha="0.1"/>
<layer val="0"/>
<labelMode val="0"/>
<slider min="-5" max="5" absoluteScreenLocation="true" width="200" x="30" y="50" fixed="false" horizontal="true" showAlgebra="false"/>
<lineStyle thickness="2" type="0" typeHidden="1"/>
<animation step="0.1" speed="1" type="0" playing="false"/>
</element>
<expression label="集合1" exp="{"x", -1}"/>
<element type="list" label="集合1">
<objColor r="0" g="100" b="0" alpha="0.1"/>
<animation step="1" speed="1" type="0" playing="false"/>
<lineStyle thickness="2" type="0" typeHidden="1"/>
<pointSize val="3"/>
<angleStyle val="0"/>
</element>
<command name="Take">
<input a0="集合1" a1="2"/>
<output a0="集合4"/>
</command>
<element type="list" label="集合4">
<objColor r="0" g="100" b="0" alpha="0.1"/>
<lineStyle thickness="2" type="0" typeHidden="1"/>
<pointSize val="3"/>
<angleStyle val="0"/>
</element>
<command name="Min">
<input a0="集合4"/>
<output a0="c"/>
</command>
<element type="numeric" label="c">
<value val="-1"/>
<objColor r="0" g="0" b="0" alpha="0.1"/>
</element>
<expression label="f" exp="f(x) = (2 * x^(2))" type="function"/>
<element type="function" label="f">
<show object="false" label="true"/>
<objColor r="0" g="0" b="0" alpha="0"/>
<layer val="0"/>
<labelMode val="0"/>
<animation step="1" speed="1" type="0" playing="false"/>
<lineStyle thickness="2" type="0" typeHidden="1"/>
</element>
<command name="Textfield">
<input a0="f"/>
<output a0="输入框1"/>
</command>
<element type="textfield" label="输入框1">
<show object="true" label="true"/>
<objColor r="0" g="0" b="0" alpha="0"/>
<layer val="0"/>
<labelOffset x="23" y="84"/>
<labelMode val="0"/>
<auxiliary val="true"/>
<font serif="false" sizeM="1.4" size="5" style="1"/>
<length val="10"/>
<caption val="函数:y="/>
</element>
<expression label="集合2" exp="{"y", 2}"/>
<element type="list" label="集合2">
<objColor r="0" g="100" b="0" alpha="0.1"/>
<animation step="1" speed="1" type="0" playing="false"/>
<lineStyle thickness="2" type="0" typeHidden="1"/>
<pointSize val="3"/>
<angleStyle val="0"/>
</element>
<expression label="集合3" exp="{(-1, 2)}"/>
<element type="list" label="集合3">
<show object="true" label="true" ev="3"/>
<objColor r="0" g="100" b="0" alpha="0"/>
<layer val="0"/>
<labelMode val="0"/>
<animation step="1" speed="1" type="0" playing="false"/>
<lineStyle thickness="2" type="0" typeHidden="1"/>
<pointSize val="3"/>
<angleStyle val="0"/>
</element>
<element type="numeric" label="a">
<value val="-1"/>
<show object="false" label="true"/>
<objColor r="0" g="0" b="0" alpha="0.1"/>
<layer val="0"/>
<labelMode val="1"/>
<animation step="1" speed="1" type="0" playing="false"/>
</element>
<expression label="b" exp="f(a)" />
<element type="numeric" label="b">
<value val="2"/>
<objColor r="0" g="0" b="0" alpha="0.1"/>
</element>
<command name="Textfield">
<input a0="a"/>
<output a0="输入框2"/>
</command>
<element type="textfield" label="输入框2">
<show object="true" label="true"/>
<objColor r="0" g="0" b="0" alpha="0"/>
<layer val="0"/>
<labelOffset x="259" y="83"/>
<labelMode val="0"/>
<auxiliary val="true"/>
<font serif="false" sizeM="1.4" size="5" style="0"/>
<length val="5"/>
<caption val="x="/>
</element>
<element type="numeric" label="n">
<value val="2"/>
<show object="false" label="true"/>
<objColor r="0" g="0" b="0" alpha="0.1"/>
<layer val="0"/>
<labelMode val="1"/>
<slider min="1" max="100" absoluteScreenLocation="true" width="200" x="279" y="48" fixed="true" horizontal="true" showAlgebra="false"/>
<lineStyle thickness="10" type="0" typeHidden="1"/>
<animation step="1" speed="1" type="0" playing="false"/>
</element>
<element type="button" label="列表描点">
<show object="true" label="true"/>
<objColor r="0" g="0" b="0" alpha="0"/>
<layer val="0"/>
<labelOffset x="378" y="81"/>
<labelMode val="0"/>
<animation step="1" speed="1" type="0" playing="false"/>
<auxiliary val="true"/>
<ggbscript val="SetValue[集合1,n+1,a]
SetValue[集合2,n+1,b]
SetValue[集合3,n,(a,b)]
n=n+1"/>
<font serif="false" sizeM="1.4" size="5" style="1"/>
</element>
<element type="button" label="按钮2">
<show object="true" label="true"/>
<objColor r="0" g="0" b="0" alpha="0"/>
<layer val="0"/>
<labelOffset x="383" y="239"/>
<labelMode val="0"/>
<animation step="1" speed="1" type="0" playing="false"/>
<auxiliary val="true"/>
<ggbscript val="集合1={"x"}
集合2={"y"}
集合3={}
n=1"/>
<font serif="false" sizeM="1.4" size="5" style="1"/>
<caption val="清除数据"/>
</element>
<element type="numeric" label="i">
<value val="0"/>
<show object="false" label="true"/>
<objColor r="0" g="0" b="0" alpha="0.1"/>
<layer val="0"/>
<labelMode val="1"/>
<animation step="1" speed="1" type="0" playing="false"/>
</element>
<command name="TableText">
<input a0="{集合1, 集合2}" a1=""|_""/>
<output a0="文本1"/>
</command>
<element type="text" label="文本1">
<show object="true" label="true"/>
<objColor r="0" g="0" b="0" alpha="0"/>
<layer val="0"/>
<labelMode val="0"/>
<isLaTeX val="true"/>
<font serif="false" sizeM="1.4" size="5" style="0"/>
<startPoint x="-13.182179512195126" y="2.1287707317073154" z="1"/>
</element>
<command name="Max">
<input a0="集合4"/>
<output a0="d"/>
</command>
<element type="numeric" label="d">
<value val="-1"/>
<objColor r="0" g="0" b="0" alpha="0.1"/>
</element>
<expression label="g" exp="g(x) = If[c - 0.5 < x < 拖动连线, f(x)]" />
<element type="function" label="g">
<show object="true" label="false" ev="11"/>
<objColor r="0" g="0" b="0" alpha="0"/>
<layer val="0"/>
<labelMode val="0"/>
<lineStyle thickness="2" type="0" typeHidden="1"/>
</element>
</construction>
</geogebra>