GeoGebra 繪圖技巧:反比函數
作者:王一哲 日期:2018/11/20
我們在〈Matplotlib 繪圖技巧:在同一張圖上繪製兩個函數、兩張圖並列〉中使用 Matplotlib 繪製反比及平方反比的函數圖形,但如果想要在函數的曲線上,沿著 x 軸方向每隔一段固定的距離畫一個點,再標示出對應的 y 軸數值,使用 Matplotlib 會有一點複雜。如果改用 GeoGebra 會比較簡單一點,成果如下圖,這個檔案的 GeoGebra 網頁版連結為 https://ggbm.at/p4hzbuza
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
反比函數圖形
繪圖步驟
請在 GeoGebra 軟體下方的輸入框中依序輸入以下的指令,輸入一行指令後要記得按 Enter 執行指令,全部執行完畢之後再隱藏不需要顯示的物件。
- 建立函數 。
f(x) = If(x >= 0.01, 1 / x)
- 畫10個點 (1, 1/1)、(2, 1/2)、(3, 1/3)、……、(10, 1/10),再將這些點指定給 points。
points = Sequence(Point({i, f(i)}), i, 1, 10)
- 將 points 當中的每個點對 x 軸畫一條垂直線,再將這些線指定給 vers。
vers = Sequence(PerpendicularLine(Element(points, i), xAxis), i, 1, 10)
- 畫出 vers 當中的每條線和 x 軸的交點,再將這些點指定給 xs。
xs = Sequence(Intersect(Element(vers, i), xAxis), i, 1, 10)
- 將 points 和 xs 當中的點依序取出,畫兩點間的線段,再將這些線段指定給 ver。
ver = Sequence(Segment(Element(points, i), Element(xs, i)), i, 1, 10)
- 將 points 當中的每個點對 y 軸畫一條垂直線,再將這些線指定給 hors。
hors = Sequence(PerpendicularLine(Element(points, i), yAxis), i, 1, 10)
- 畫出 hors 當中的每條線和 y 軸的交點,再將這些點指定給 ys。
ys = Sequence(Intersect(Element(hors, i), yAxis), i, 1, 10)
- 將 points 和 ys 當中的點依序取出,畫兩點間的線段,再將這些線段指定給 hor。
hor = Sequence(Segment(Element(points, i), Element(ys, i)), i, 1, 10)
應用
我們可以用同樣的方法畫出其它的函數圖形,只要修改 f(x) 的定義即可。下圖為平方反比的函數圖形,我們可以看到當 x 的數值越大時,應的 y 軸數值很下降很快。但如果只看到這條曲線時,我們很難判斷它是反比還是平方反比的圖形,我們將兩種函數圖形畫在同一張圖上,同學們可以比較看看。
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
平方反比函數圖形
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
反比(藍色線條)與平方反比(綠色線條)函數圖形比較
GeoGebra 官方說明書
- 條件判斷 If: https://wiki.geogebra.org/en/If
- 迴圈 Sequence: https://wiki.geogebra.org/en/Sequence_Command
- 點 Point: https://wiki.geogebra.org/en/Point
- 垂直線 PerpendicularLine: https://wiki.geogebra.org/en/PerpendicularLine
- 元素 Element: https://wiki.geogebra.org/en/Element
- 交點 Intersect: https://wiki.geogebra.org/en/Intersect_Command
- 線段 Segment: https://wiki.geogebra.org/en/Segment_Command