陰関数

xy 座標上の関数 \(f(x, y) = 0\) で表現されるグラフのプロットを考える.

手法

三次元グラフとして描画し, これを \(z=0\) 平面で切り取ると目的のグラフが得られる. そこで 等高線 を \(z=0\) のみ描画することで実現する.

Examples

\(x^2 + xy + y^2 = 1\) を描画する. \(f(x,y) = x^2 + xy + y^2 - 1\) として, \(f(x,y)=0\) の形にする.

set view 0,0
unset surface
set isosamples 100,100
set contour
set cntrparam levels discrete 0
set xrange [-2:2]
set yrange [-2:2]

f(x, y) = x * x + x * y + y * y - 1
splot f(x, y)
Gnuplot Produced by GNUPLOT 6.0 patchlevel 0 -2 -1.5 -1 -0.5 0 0.5 1 1.5 2 -2 -1.5 -1 -0.5 0 0.5 1 1.5 2 gnuplot_plot_1 f(x, y) 0

\(f(x,y) = x^2 - y^2 = 0\) を描画する.

set view 0,0
unset surface
set isosamples 100,100
set contour
set cntrparam levels discrete 0
set xrange [-2:2]
set yrange [-2:2]

f(x, y) = x * x - y * y
splot f(x, y)
Gnuplot Produced by GNUPLOT 6.0 patchlevel 0 -2 -1.5 -1 -0.5 0 0.5 1 1.5 2 -2 -1.5 -1 -0.5 0 0.5 1 1.5 2 gnuplot_plot_1 f(x, y) 0