阶梯函数:向上取整、向下取整与四舍五入
2014-04-25 01:05
本范例演示了三种常见的阶梯函数(取整函数)的图像与性质:向上取整函数 ceil(x)、向下取整函数 floor(x) 以及四舍五入函数 round(x)。通过 GeoGebra 绘制的函数图像,直观展示了这些函数在不连续点处的跳跃特性,并精确区分了实心点(函数值)与空心点(极限值)。此外,还展示了四舍五入函数与向下取整函数的等价关系:round(x) = floor(x + 1/2)。适合用于高中或大学微积分、离散数学课程中理解分段函数与取整运算。
所属专题
函数
GeoGebra 画板及绘图内容加载中,请稍等……
<?xml version="1.0" encoding="utf-8"?>
<geogebra format="4.4" version="4.4.28.0" id="8685e3fb-8d80-4462-bef8-e3fe41469de5" xsi:noNamespaceSchemaLocation="http://www.geogebra.org/ggb.xsd" xmlns="" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >
<gui>
<window width="800" height="600" />
<perspectives>
<perspective id="tmp">
<panes>
<pane location="" divider="0.25" orientation="1" />
</panes>
<views>
<view id="4097" visible="false" inframe="true" stylebar="true" location="1,1,1" size="400" window="777,434,700,550" />
<view id="4" toolbar="0 59 || 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="8" toolbar="1001 | 1002 | 1003 || 1005 | 1004 || 1006 | 1007 | 1010 | 1011 || 1008 1009 || 66 68 || 6" visible="false" inframe="false" stylebar="false" location="1,3" size="300" window="100,100,600,400" />
<view id="1" visible="true" inframe="false" stylebar="true" location="1" size="789" window="100,100,600,400" />
<view id="2" visible="false" inframe="false" stylebar="false" location="3" size="200" 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="32" visible="false" inframe="false" stylebar="true" location="1" size="150" window="50,50,500,500" />
<view id="64" visible="false" inframe="true" stylebar="true" location="1" size="150" window="50,50,500,500" />
<view id="70" toolbar="0 || 2020 || 2021 || 2022" visible="false" inframe="true" stylebar="true" location="1" size="150" window="50,50,500,500" />
</views>
<toolbar show="true" items="0 39 59 | 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="false" />
<dockBar show="true" east="true" />
</perspective>
</perspectives>
<labelingStyle val="3"/>
<font size="12"/>
<graphicsSettings javaLatexFonts="false"/>
</gui>
<euclidianView>
<size width="789" height="463"/>
<coordSystem xZero="383.48064289843745" yZero="231.68760498934662" scale="52.68197887073866" yscale="52.681978870738696"/>
<evSettings axes="true" grid="true" gridIsBold="false" pointCapturing="3" rightAngleStyle="1" checkboxSize="26" gridType="0"/>
<bgColor r="255" g="255" b="255"/>
<axesColor r="128" g="128" b="128"/>
<gridColor r="192" g="192" b="192"/>
<lineStyle axes="0" grid="20"/>
<axis id="0" show="true" label="" unitLabel="" tickStyle="1" showNumbers="true" tickDistance="1.0"/>
<axis id="1" show="true" label="" unitLabel="" tickStyle="1" showNumbers="true" tickDistance="1.0"/>
</euclidianView>
<kernel>
<continuous val="false"/>
<usePathAndRegionParameters val="true"/>
<decimals val="2"/>
<angleUnit val="degree"/>
<algebraStyle val="0"/>
<coordStyle val="0"/>
<angleFromInvTrig val="false"/>
</kernel>
<scripting blocked="false" disabled="false"/>
<construction title="" author="" date="">
<expression label ="f" exp="f(x) = ceil(x)"/>
<element type="function" label="f">
<show object="true" label="false"/>
<condition showObject="a"/>
<objColor r="255" g="0" b="0" alpha="0.0"/>
<layer val="0"/>
<labelMode val="0"/>
<animation step="0.1" speed="1" type="0" playing="false"/>
<lineStyle thickness="5" type="0" typeHidden="1"/>
</element>
<expression label="x1" exp="floor(x(Corner[1]))" />
<element type="numeric" label="x1">
<value val="-8.0"/>
<objColor r="0" g="0" b="0" alpha="0.1"/>
</element>
<expression label="x2" exp="floor(x(Corner[2]))" />
<element type="numeric" label="x2">
<value val="7.0"/>
<objColor r="0" g="0" b="0" alpha="0.1"/>
</element>
<command name="Sequence">
<input a0="(k, k)" a1="k" a2="x1" a3="x2"/>
<output a0="solid"/>
</command>
<element type="list" label="solid">
<show object="true" label="false"/>
<condition showObject="a ∨ b"/>
<objColor r="0" g="0" b="0" alpha="0.0"/>
<layer val="1"/>
<labelMode val="0"/>
<selectionAllowed val="false"/>
<lineStyle thickness="2" type="0" typeHidden="1"/>
<pointSize val="4"/>
<pointStyle val="-1"/>
</element>
<command name="Sequence">
<input a0="(k, k + 1)" a1="k" a2="x1" a3="x2"/>
<output a0="holes"/>
</command>
<element type="list" label="holes">
<show object="true" label="false"/>
<condition showObject="a"/>
<objColor r="255" g="255" b="255" alpha="0.0"/>
<layer val="1"/>
<labelMode val="0"/>
<selectionAllowed val="false"/>
<lineStyle thickness="2" type="0" typeHidden="1"/>
<pointSize val="4"/>
<pointStyle val="-1"/>
</element>
<expression label ="g" exp="g(x) = floor(x)"/>
<element type="function" label="g">
<show object="true" label="false"/>
<condition showObject="b"/>
<objColor r="0" g="0" b="255" alpha="0.0"/>
<layer val="0"/>
<labelMode val="0"/>
<animation step="0.1" speed="1" type="0" playing="false"/>
<selectionAllowed val="false"/>
<lineStyle thickness="5" type="0" typeHidden="1"/>
</element>
<command name="Sequence">
<input a0="(k, k - 1)" a1="k" a2="x1" a3="x2"/>
<output a0="holes2"/>
</command>
<element type="list" label="holes2">
<show object="true" label="false"/>
<condition showObject="b"/>
<objColor r="255" g="255" b="255" alpha="0.0"/>
<layer val="1"/>
<labelMode val="0"/>
<lineStyle thickness="2" type="0" typeHidden="1"/>
<pointSize val="4"/>
<pointStyle val="-1"/>
</element>
<command name="LaTeX">
<input a0="f" a1="true" a2="false"/>
<output a0="text1"/>
</command>
<element type="text" label="text1">
<show object="true" label="false"/>
<objColor r="255" g="0" b="0" alpha="0.0"/>
<layer val="1"/>
<labelMode val="0"/>
<isLaTeX val="true"/>
<font serif="false" sizeM="1.4" size="5" style="0"/>
<absoluteScreenLocation x="48" y="21"/>
</element>
<command name="LaTeX">
<input a0="g" a1="true" a2="false"/>
<output a0="text2"/>
</command>
<element type="text" label="text2">
<show object="true" label="false"/>
<objColor r="0" g="0" b="255" alpha="0.0"/>
<layer val="1"/>
<labelMode val="0"/>
<isLaTeX val="true"/>
<font serif="false" sizeM="1.4" size="5" style="0"/>
<absoluteScreenLocation x="50" y="75"/>
</element>
<element type="boolean" label="a">
<value val="false"/>
<show object="true" label="false"/>
<objColor r="0" g="0" b="0" alpha="0.0"/>
<layer val="1"/>
<labelOffset x="10" y="16"/>
<labelMode val="0"/>
</element>
<element type="boolean" label="b">
<value val="true"/>
<show object="true" label="false"/>
<objColor r="0" g="0" b="255" alpha="0.0"/>
<layer val="1"/>
<labelOffset x="10" y="69"/>
<labelMode val="0"/>
</element>
<expression label ="h" exp="h(x) = floor(x + 1 / 2)"/>
<element type="function" label="h">
<show object="true" label="false"/>
<condition showObject="c"/>
<objColor r="51" g="153" b="0" alpha="0.0"/>
<layer val="0"/>
<labelMode val="0"/>
<animation step="0.1" speed="1" type="0" playing="false"/>
<selectionAllowed val="false"/>
<lineStyle thickness="5" type="0" typeHidden="1"/>
</element>
<command name="Sequence">
<input a0="(k - 1 / 2, k)" a1="k" a2="x1" a3="x2"/>
<output a0="solidRound"/>
</command>
<element type="list" label="solidRound">
<show object="true" label="false"/>
<condition showObject="c"/>
<objColor r="0" g="0" b="0" alpha="0.0"/>
<layer val="1"/>
<labelMode val="0"/>
<selectionAllowed val="false"/>
<lineStyle thickness="2" type="0" typeHidden="1"/>
<pointSize val="4"/>
<pointStyle val="-1"/>
</element>
<command name="Sequence">
<input a0="(k + 1 / 2, k)" a1="k" a2="x1" a3="x2"/>
<output a0="holesRound"/>
</command>
<element type="list" label="holesRound">
<show object="true" label="false"/>
<condition showObject="c"/>
<objColor r="255" g="255" b="255" alpha="0.0"/>
<layer val="1"/>
<labelMode val="0"/>
<selectionAllowed val="false"/>
<lineStyle thickness="2" type="0" typeHidden="1"/>
<pointSize val="4"/>
<pointStyle val="-1"/>
</element>
<element type="boolean" label="c">
<value val="false"/>
<show object="true" label="false"/>
<objColor r="0" g="0" b="0" alpha="0.0"/>
<layer val="1"/>
<labelOffset x="10" y="121"/>
<labelMode val="0"/>
</element>
<expression label="text4" exp=""ceil(x):天花板函數""/>
<element type="text" label="text4">
<show object="true" label="false"/>
<objColor r="255" g="0" b="0" alpha="0.0"/>
<layer val="1"/>
<labelMode val="0"/>
<font serif="false" sizeM="1.4" size="5" style="0"/>
<absoluteScreenLocation x="139" y="40"/>
</element>
<expression label ="p" exp="p(x) = round(x)"/>
<element type="function" label="p">
<show object="false" label="false"/>
<objColor r="0" g="0" b="0" alpha="0.0"/>
<layer val="1"/>
<labelMode val="0"/>
<animation step="0.1" speed="1" type="0" playing="false"/>
<lineStyle thickness="2" type="0" typeHidden="1"/>
</element>
<expression label="text5" exp=""floor(x):地板函數、高斯符號""/>
<element type="text" label="text5">
<show object="true" label="false"/>
<objColor r="0" g="0" b="255" alpha="0.0"/>
<layer val="1"/>
<labelMode val="0"/>
<font serif="false" sizeM="1.4" size="5" style="0"/>
<absoluteScreenLocation x="129" y="93"/>
</element>
<expression label="text6" exp=""round(x):四捨五入""/>
<element type="text" label="text6">
<show object="true" label="false"/>
<objColor r="0" g="153" b="0" alpha="0.0"/>
<layer val="1"/>
<labelMode val="0"/>
<font serif="false" sizeM="1.4" size="5" style="0"/>
<absoluteScreenLocation x="122" y="145"/>
</element>
<command name="LaTeX">
<input a0="h" a1="true" a2="false"/>
<output a0="text7"/>
</command>
<element type="text" label="text7">
<show object="true" label="false"/>
<objColor r="0" g="153" b="0" alpha="0.0"/>
<layer val="1"/>
<labelMode val="0"/>
<isLaTeX val="true"/>
<font serif="false" sizeM="1.0" size="0" style="0"/>
<absoluteScreenLocation x="50" y="119"/>
</element>
</construction>
</geogebra>