将军饮马问题——最短路径的几何作图与动态演示
2020-04-01 13:46
本GeoGebra范例演示经典几何优化问题'将军饮马':在直线(河流)同侧有两点A和B,求从A出发到直线上某点P饮马后再到B的最短路径。通过构造点关于直线的对称点,利用'两点之间线段最短'原理,找到最优饮水点P。范例使用Point、Segment、LineBisector、Intersect等命令进行几何作图,包含动态文本说明和交互按钮,直观展示轴对称变换在最短路径问题中的应用,帮助理解反射原理与最值优化的几何本质。
所属专题
GeoGebra与初中数学课程深度融合
<?xml version="1.0" encoding="utf-8"?>
<geogebra format="5.0" version="5.0.574.0" app="classic" platform="d" id="5f1d549f-1e2c-43ad-aaf8-61c17cb4c9b7" xsi:noNamespaceSchemaLocation="http://www.geogebra.org/apps/xsd/ggb.xsd" xmlns="" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >
<gui>
<window width="1440" height="860" />
<perspectives>
<perspective id="tmp">
<panes>
<pane location="" divider="0.5527777777777778" orientation="1" />
<pane location="0" divider="0.20555555555555555" orientation="1" />
<pane location="0,1" divider="0.2777777777777778" orientation="1" />
</panes>
<views>
<view id="1" visible="true" inframe="false" stylebar="true" location="3,1,3" size="495" window="100,100,600,400" />
<view id="512" toolbar="0 | 1 501 5 19 , 67 | 2 15 45 18 , 7 37 | 514 3 9 , 13 44 , 47 | 16 51 | 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" visible="false" inframe="false" stylebar="false" location="1,1,1" size="500" window="100,100,600,400" />
<view id="2" visible="true" inframe="false" stylebar="true" location="3,3" size="296" 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="false" location="1,3" size="300" 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="true" location="1" size="295" window="100,100,600,400" />
<view id="16" visible="false" inframe="false" stylebar="false" location="1" size="733" 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="false" location="1" size="150" window="50,50,500,500" />
<view id="4097" visible="true" inframe="false" stylebar="true" location="1" size="623" window="100,100,700,550" />
<view id="70" toolbar="0 || 2020 || 2021 || 2022" visible="false" inframe="false" stylebar="true" location="1" size="150" window="50,50,500,500" />
</views>
<toolbar show="true" 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 | 100006 100005 100004 100003 100002 100001" position="1" help="true" />
<input show="true" cmd="true" top="true" />
<dockBar show="false" east="false" />
</perspective>
</perspectives>
<labelingStyle val="3"/>
<font size="16"/>
</gui>
<euclidianView>
<viewNumber viewNo="1"/>
<size width="495" height="653"/>
<coordSystem xZero="179.65055138841478" yZero="386.2726051033096" scale="65.81736802942294" yscale="65.81736802942292"/>
<evSettings axes="false" grid="false" gridIsBold="false" pointCapturing="3" rightAngleStyle="1" checkboxSize="26" gridType="3"/>
<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>
<algebraView>
<mode val="3"/>
</algebraView>
<kernel>
<continuous val="false"/>
<usePathAndRegionParameters val="true"/>
<decimals val="2"/>
<angleUnit val="degree"/>
<algebraStyle val="2" spreadsheet="0"/>
<coordStyle val="0"/>
</kernel>
<tableview min="-2.0" max="2.0" step="1.0"/>
<scripting blocked="false" disabled="false"/>
<construction title="" author="" date="">
<expression label="text1" exp=""直线L的同侧有两个定点A,B,\\
L上有一动点P,试探就|PA-PB|的最大与最小值。""/>
<element type="text" label="text1">
<show object="true" label="false" ev="40"/>
<objColor r="0" g="0" b="0" alpha="0.0"/>
<bgColor r="191" g="255" b="0" alpha="255"/>
<layer val="0"/>
<labelMode val="0"/>
<isLaTeX val="true"/>
<font serif="true" sizeM="1.4" size="7" style="1"/>
<startPoint x="-1.772336920799801" y="5.443435613273807" z="1.0"/>
</element>
<expression label="f" exp="y = 0" type="line"/>
<element type="line" label="f">
<show object="true" label="false"/>
<objColor r="153" g="51" b="0" alpha="0.0"/>
<layer val="0"/>
<labelMode val="0"/>
<fixed val="true"/>
<coords x="0.0" y="1.0" z="0.0"/>
<lineStyle thickness="10" type="0" typeHidden="1" opacity="178"/>
<eqnStyle style="explicit"/>
</element>
<element type="point" label="A">
<show object="true" label="true"/>
<objColor r="77" g="77" b="255" alpha="0.0"/>
<layer val="0"/>
<labelOffset x="-40" y="18"/>
<labelMode val="0"/>
<animation step="0.1" speed="1" type="1" playing="false"/>
<coords x="-0.7543685333363538" y="3.0428534458226886" z="1.0"/>
<pointSize val="5"/>
<pointStyle val="0"/>
</element>
<element type="point" label="B">
<show object="true" label="true"/>
<objColor r="77" g="77" b="255" alpha="0.0"/>
<layer val="0"/>
<labelMode val="0"/>
<animation step="0.1" speed="1" type="1" playing="false"/>
<coords x="2.3603108611413615" y="1.0373037869394763" z="1.0"/>
<pointSize val="5"/>
<pointStyle val="0"/>
</element>
<command name="Point">
<input a0="f"/>
<output a0="P"/>
</command>
<element type="point" label="P">
<show object="true" label="true" ev="4"/>
<objColor r="125" g="125" b="255" alpha="0.0"/>
<layer val="0"/>
<labelOffset x="-7" y="35"/>
<labelMode val="0"/>
<animation step="1" speed="1" type="1" playing="false"/>
<coords x="-0.510640432986779" y="0.0" z="1.0"/>
<pointSize val="5"/>
<pointStyle val="0"/>
</element>
<command name="Segment">
<input a0="P" a1="A"/>
<output a0="g"/>
</command>
<element type="segment" label="g">
<show object="true" label="false"/>
<objColor r="0" g="0" b="255" alpha="0.0"/>
<layer val="0"/>
<labelMode val="0"/>
<coords x="-3.0428534458226886" y="-0.24372810034957482" z="-1.55380400109021"/>
<lineStyle thickness="5" type="0" typeHidden="1" opacity="178"/>
<outlyingIntersections val="false"/>
<keepTypeOnTransform val="true"/>
</element>
<command name="Segment">
<input a0="P" a1="B"/>
<output a0="h"/>
</command>
<element type="segment" label="h">
<show object="true" label="false"/>
<objColor r="0" g="0" b="255" alpha="0.0"/>
<layer val="0"/>
<labelMode val="0"/>
<coords x="-1.0373037869394763" y="2.8709512941281403" z="-0.5296892549015997"/>
<lineStyle thickness="5" type="0" typeHidden="1" opacity="178"/>
<outlyingIntersections val="false"/>
<keepTypeOnTransform val="true"/>
</element>
<command name="Segment">
<input a0="A" a1="B"/>
<output a0="i"/>
</command>
<element type="segment" label="i">
<show object="true" label="false"/>
<objColor r="255" g="0" b="0" alpha="0.0"/>
<layer val="0"/>
<labelMode val="0"/>
<coords x="2.0055496588832122" y="3.114679394477715" z="-7.964589373414487"/>
<lineStyle thickness="5" type="10" typeHidden="1" opacity="178"/>
<outlyingIntersections val="false"/>
<keepTypeOnTransform val="true"/>
</element>
<expression label="a" exp="abs(g - h)" />
<element type="numeric" label="a">
<value val="0.0"/>
<objColor r="0" g="0" b="0" alpha="0.10000000149011612"/>
</element>
<expression label="text2" exp=""请你观察点P运动过程中,线段PA、PB差的最值变化:
\\|PA-PB|=| " + (LaTeX[g]) + "- " + (LaTeX[h]) + "|= " + (LaTeX[a]) + " " + (LaTeX[If[a < i, "<", "="]]) + "AB=" + (LaTeX[i]) + " "" />
<element type="text" label="text2">
<show object="true" label="false" ev="8"/>
<condition showObject="b"/>
<objColor r="0" g="0" b="0" alpha="0.0"/>
<bgColor r="255" g="255" b="0" alpha="255"/>
<layer val="0"/>
<labelMode val="0"/>
<isLaTeX val="true"/>
<font serif="true" sizeM="1.4" size="7" style="1"/>
<startPoint x="0.02050292577761592" y="-1.8342786791887598" z="1.0"/>
</element>
<element type="button" label="button1">
<show object="true" label="true"/>
<objColor r="0" g="0" b="0" alpha="0.0"/>
<layer val="0"/>
<labelOffset x="910" y="506"/>
<labelMode val="0"/>
<fixed val="true"/>
<auxiliary val="true"/>
<ggbscript val="
SetValue(d,false)
SetValue(P,C)"/>
<font serif="false" sizeM="2.0" size="16" style="0"/>
<caption val="最大值"/>
</element>
<element type="boolean" label="b">
<value val="true"/>
<show object="true" label="true"/>
<objColor r="0" g="0" b="0" alpha="0.0"/>
<layer val="0"/>
<labelOffset x="84" y="529"/>
<labelMode val="0"/>
<checkbox fixed="true"/>
<caption val="试验"/>
</element>
<command name="LineBisector">
<input a0="i"/>
<output a0="k"/>
</command>
<element type="line" label="k">
<show object="true" label="false" ev="4"/>
<condition showObject="d"/>
<objColor r="0" g="0" b="0" alpha="0.0"/>
<layer val="0"/>
<labelMode val="0"/>
<coords x="-3.114679394477715" y="2.0055496588832122" z="-1.590481234611099"/>
<lineStyle thickness="5" type="20" typeHidden="1" opacity="178"/>
<eqnStyle style="implicit"/>
</element>
<command name="Intersect">
<input a0="f" a1="k"/>
<output a0="D"/>
</command>
<element type="point" label="D">
<show object="false" label="true"/>
<objColor r="68" g="68" b="68" alpha="0.0"/>
<layer val="0"/>
<labelMode val="0"/>
<coords x="-1.590481234611099" y="0.0" z="3.114679394477715"/>
<pointSize val="4"/>
<pointStyle val="0"/>
</element>
<element type="button" label="button2">
<show object="true" label="true"/>
<objColor r="0" g="0" b="0" alpha="0.0"/>
<layer val="0"/>
<labelOffset x="930" y="572"/>
<labelMode val="0"/>
<fixed val="true"/>
<auxiliary val="true"/>
<ggbscript val="SetValue(P,D)
SetValue(d,true)"/>
<font serif="false" sizeM="2.0" size="16" style="0"/>
<caption val="最小值"/>
</element>
<command name="Intersect">
<input a0="Line[A, B]" a1="f"/>
<output a0="C"/>
</command>
<element type="point" label="C">
<show object="false" label="true"/>
<objColor r="68" g="68" b="68" alpha="0.0"/>
<layer val="0"/>
<labelMode val="0"/>
<coords x="7.964589373414487" y="-0.0" z="2.0055496588832122"/>
<pointSize val="4"/>
<pointStyle val="0"/>
</element>
<expression label="text3" exp=""当P、A、B三点共线时,|PA-PB|差值最大,就是线段AB的长度;
\\P、A、B三点不共线时,在ΔPAB中,|PA-PB|的差值永远小于AB;
\\点P在线段AB的垂直平分线上时,|PA-PB|=0""/>
<element type="text" label="text3">
<show object="true" label="false" ev="40"/>
<condition showObject="c"/>
<objColor r="0" g="0" b="0" alpha="0.0"/>
<bgColor r="191" g="255" b="0" alpha="255"/>
<layer val="0"/>
<labelMode val="0"/>
<isLaTeX val="true"/>
<font serif="true" sizeM="1.0" size="0" style="1"/>
<startPoint x="4.472215426177472" y="1.2804007152889567" z="1.0"/>
</element>
<element type="boolean" label="c">
<value val="false"/>
<show object="true" label="true"/>
<objColor r="0" g="0" b="0" alpha="0.0"/>
<layer val="0"/>
<labelOffset x="981" y="220"/>
<labelMode val="0"/>
<checkbox fixed="true"/>
<caption val="结论"/>
</element>
<element type="boolean" label="d">
<value val="true"/>
<show object="false" label="true"/>
<objColor r="0" g="0" b="0" alpha="0.0"/>
<layer val="0"/>
<labelOffset x="960" y="457"/>
<labelMode val="0"/>
<checkbox fixed="true"/>
</element>
</construction>
</geogebra>