Uniform Motion Point Tool on Polyline
2020-05-10 04:25
This GeoGebra example demonstrates a construction tool for a point moving at a constant speed along a polyline. By utilizing commands such as PolyLine, Sequence, Append, and conditional statements, it achieves the animation effect of a point moving uniformly along a multi-segment path. This tool can be used to illustrate path motion, piecewise functions, or combined uniform linear motions, helping
<?xml version="1.0" encoding="utf-8"?>
<geogebra format="5.0" version="5.0.581.0" app="classic" platform="w" id="52d7d99e-00d3-474c-b71b-314033421a48" xsi:noNamespaceSchemaLocation="https://ggb123.cn/apps/xsd/ggb.xsd" xmlns="" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >
<gui>
<window width="1355" height="572" />
<perspectives>
<perspective id="tmp">
<panes>
<pane location="" divider="0.2767527675276753" orientation="1" />
</panes>
<views>
<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="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,1" size="300" 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="32" visible="false" inframe="false" stylebar="true" location="1,3" size="215" window="50,50,500,500" />
<view id="1" visible="true" inframe="false" stylebar="true" location="1" size="1355" window="100,100,600,400" />
<view id="2" visible="false" inframe="false" stylebar="true" location="3" size="375" window="100,100,600,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="false" 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="4097" visible="false" inframe="false" stylebar="true" location="1" size="383" 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" />
<view id="43" visible="false" inframe="false" stylebar="false" location="1" size="450" window="50,50,500,500" />
</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 100019 100021 41 42 100032 100052 100051 , 27 28 35 , 6 | 100003 100002 | 100004 100005 100008 100006 100007 100055 100056 100057 100058 100059 100060 100061 100062 100063 100064 100065 100066 100067 100068 100069 100070 100071 100072 100073 100074 100075 100076 100077 100078 100079 100080 100081 100082 100083 100084 100085 100086 100087 100088 100089 100090 100091 100092 100093 100094 100095 100096 100097 100098 100099 100100 100101 100102 100103 100104 | 100001 | 100009 100011 100010 100014 100049 100016 100017 100046 100045 100047 100048 | 100041 100043 100034 100035 100037 100038 100039 100040 100044 100036 100026 | 100008 100027 100024 100028 100029 100030 100031 100050" position="1" help="false" />
<input show="false" cmd="true" top="algebra" />
<dockBar show="false" east="false" />
</perspective>
</perspectives>
<labelingStyle val="0"/>
<font size="16"/>
</gui>
<euclidianView>
<viewNumber viewNo="1"/>
<size width="1354" height="571"/>
<coordSystem xZero="118.36545238533193" yZero="275.86037424850775" scale="62.1021921667866" yscale="62.10217284718856"/>
<evSettings axes="true" grid="true" 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="true" label="" unitLabel="" tickStyle="1" showNumbers="true" positiveAxis="true"/>
<axis id="1" show="true" label="" unitLabel="" tickStyle="1" showNumbers="true" positiveAxis="true"/>
<grid distX="1" distY="1" distTheta="0.5235987755982988"/>
</euclidianView>
<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" max="2" step="1"/>
<scripting blocked="false" disabled="false"/>
<construction title="" author="" date="">
<expression label="l1" exp="{(0, 0), (1, 0), (3, 1), (5, 3)}"/>
<element type="list" label="l1">
<show object="true" label="true" ev="4"/>
<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="5" type="0" typeHidden="1"/>
<pointSize val="5"/>
<pointStyle val="0"/>
<angleStyle val="0"/>
</element>
<command name="PolyLine">
<input a0="l1"/>
<output a0="f"/>
</command>
<element type="polyline" label="f">
<lineStyle thickness="5" type="0" typeHidden="1" opacity="178"/>
<show object="true" label="false" ev="8"/>
<objColor r="0" g="0" b="0" alpha="0"/>
<layer val="0"/>
<labelMode val="0"/>
</element>
<command name="Sequence">
<input a0="abs(l1(k + 1) - l1(k))" a1="k" a2="1" a3="Length[l1] - 1"/>
<output a0="l2"/>
</command>
<element type="list" label="l2">
<objColor r="0" g="100" b="0" alpha="0.10000000149011612"/>
<lineStyle thickness="5" type="0" typeHidden="1"/>
<pointSize val="5"/>
<angleStyle val="0"/>
</element>
<element type="numeric" label="v">
<value val="1.2"/>
<show object="false" label="true"/>
<objColor r="0" g="0" b="0" alpha="0.10000000149011612"/>
<layer val="0"/>
<labelOffset x="-8" y="-3"/>
<labelMode val="1"/>
<slider min="-5" max="5" width="2" x="0.40517590449518026" y="-2.091170720275782" fixed="false" horizontal="true" showAlgebra="true"/>
<lineStyle thickness="10" type="0" typeHidden="1"/>
<animation speed="1" type="0" playing="false"/>
</element>
<command name="Append">
<input a0="0" a1="Sequence[Sum[l2, k] / v, k, 1, Length[l2]]"/>
<output a0="l3"/>
</command>
<element type="list" label="l3">
<objColor r="0" g="100" b="0" alpha="0.10000000149011612"/>
<lineStyle thickness="5" type="0" typeHidden="1"/>
<pointSize val="5"/>
<angleStyle val="0"/>
</element>
<element type="numeric" label="t">
<value val="2.148"/>
<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="f / v" absoluteScreenLocation="true" width="200" x="251" y="475" fixed="false" horizontal="true" showAlgebra="true"/>
<lineStyle thickness="10" type="0" typeHidden="1"/>
<animation speed="0.4" type="0" playing="true"/>
</element>
<command name="CountIf">
<input a0="t ≥ p" a1="p" a2="l3"/>
<output a0="a"/>
</command>
<element type="numeric" label="a">
<value val="2"/>
<objColor r="0" g="0" b="0" alpha="0.10000000149011612"/>
</element>
<command name="If">
<input a0="a < Length[l1]" a1="l1(a) + ((v * (t - l3(a))) * UnitVector[l1(a + 1) - l1(a)])" a2="l1(a)"/>
<output a0="A"/>
</command>
<element type="point" label="A">
<show object="true" label="true" ev="4"/>
<objColor r="255" g="0" b="255" alpha="0"/>
<layer val="0"/>
<labelOffset x="-9" y="-7"/>
<labelMode val="0"/>
<coords x="2.411048336521467" y="0.7055241682607336" z="1"/>
<pointSize val="6"/>
<pointStyle val="0"/>
<caption val="$\Large{动点} $"/>
</element>
<expression label="text1" exp=""制作:肖建伟\\
公众号:\ \ GeoGebra物理数学可视化\\
QQ群:\ \ 583765627""/>
<element type="text" label="text1">
<show object="true" label="true" ev="40"/>
<condition showObject="b"/>
<objColor r="255" g="255" b="0" alpha="0"/>
<bgColor r="0" g="0" b="0" alpha="255"/>
<layer val="0"/>
<labelMode val="0"/>
<isLaTeX val="true"/>
<font serif="true" sizeM="1" size="0" style="0"/>
<startPoint x="7.91654095388928" y="-1.6608054279402171" z="1"/>
</element>
<element type="boolean" label="b">
<value val="true"/>
<show object="true" label="true"/>
<objColor r="0" g="0" b="0" alpha="0"/>
<layer val="0"/>
<labelOffset x="502" y="406"/>
<labelMode val="0"/>
<checkbox fixed="true"/>
<caption val="帮助"/>
</element>
</construction>
</geogebra>