#14 ふれてみよう高校数学 関数

関数のグラフ変換

グラフ変換の基本一覧

y=x2y = x^2 のグラフを右に2つ、上に3つ動かすと?」——グラフ変換とは、知っているグラフを「動かす・裏返す・伸び縮みさせる」操作です。一つの式を覚えれば、その変形パターンをすべて理解できます。

y=f(x)y = f(x) を基準としたとき:

変換グラフの移動
y=f(xa)y = f(x - a)xx 方向に +a+a(右に aa)移動
y=f(x)+by = f(x) + byy 方向に +b+b(上に bb)移動
y=f(x)y = f(-x)yy 軸に関して対称移動
y=f(x)y = -f(x)xx 軸に関して対称移動
y=f(ax)y = f(ax)xx 方向に 1a\dfrac{1}{a} に圧縮
y=af(x)y = af(x)yy 方向に aa 倍に拡大
y=f(x)y = \lvert f(x) \rvertxx 軸の下部を折り返し
y=f(x)y = f(\lvert x \rvert)yy 軸の左部を折り返し

重要な注意点

y=f(xa)y = f(x - a)a>0a > 0 のとき、グラフはaa 移動します(xx から aa を引くと方向という点が紛らわしいので注意)。

「マイナスなのに右に動く」——直感と逆に思えますが、こう考えてください:「f(xa)=bf(x-a) = b になるのはどの xx か?」→ x=f1(b)+ax = f^{-1}(b) + a、つまり元より aa だけ右の場所です。

確認方法f(xa)=bf(x-a) = b になるのは xa=f1(b)x - a = f^{-1}(b)、つまり元の f1(b)f^{-1}(b) よりも xxaa だけ大きい位置。


インタラクティブデモ:y=x2y = x^2 の各種変換

マウスを左右に動かすと、変換のパラメータが変わります。基準関数 y=x2y = x^2(薄い白)と変換後のグラフ(明るい色)を比較してください——青い放物線の頂点がマウスの位置に合わせて左右に動くのが、「横移動」の視覚的な確認になります。

マウスを左右に動かして変換パラメータを変えてみよう
function loop() {
ctx.clearRect(0, 0, W, H);

var ox = W / 2, oy = H / 2 + 20;
var scale = 45;
var t = (mx / W) * 4 - 2;

function toScreen(x, y) {
  return { sx: ox + x * scale, sy: oy - y * scale };
}

// Grid
ctx.strokeStyle = 'rgba(255,255,255,0.06)';
ctx.lineWidth = 1;
for (var gx = -6; gx <= 6; gx++) {
  var gs = toScreen(gx, 0);
  ctx.beginPath(); ctx.moveTo(gs.sx, 0); ctx.lineTo(gs.sx, H); ctx.stroke();
}
for (var gy = -2; gy <= 5; gy++) {
  var gs2 = toScreen(0, gy);
  ctx.beginPath(); ctx.moveTo(0, gs2.sy); ctx.lineTo(W, gs2.sy); ctx.stroke();
}

// Axes
ctx.strokeStyle = 'rgba(255,255,255,0.3)';
ctx.lineWidth = 1.5;
ctx.beginPath(); ctx.moveTo(0, oy); ctx.lineTo(W, oy); ctx.stroke();
ctx.beginPath(); ctx.moveTo(ox, 0); ctx.lineTo(ox, H); ctx.stroke();

// Axis labels
ctx.fillStyle = 'rgba(255,255,255,0.35)';
ctx.font = '11px sans-serif';
for (var lx = -5; lx <= 5; lx++) {
  if (lx === 0) continue;
  var ls = toScreen(lx, 0);
  ctx.fillText(lx, ls.sx - 4, oy + 14);
}
for (var ly = -1; ly <= 4; ly++) {
  if (ly === 0) continue;
  var ls2 = toScreen(0, ly);
  ctx.fillText(ly, ox + 4, ls2.sy + 4);
}

// Base function y=x^2 (dim white)
ctx.strokeStyle = 'rgba(255,255,255,0.2)';
ctx.lineWidth = 1.5;
ctx.beginPath();
var stB = false;
for (var xi = -6; xi <= 6; xi += 0.04) {
  var yi = xi * xi;
  if (yi > 6) { stB = false; continue; }
  var s = toScreen(xi, yi);
  if (!stB) { ctx.moveTo(s.sx, s.sy); stB = true; } else ctx.lineTo(s.sx, s.sy);
}
ctx.stroke();

function drawCurve(fn, color, lineWidth) {
  ctx.strokeStyle = color;
  ctx.lineWidth = lineWidth || 2.5;
  ctx.beginPath();
  var st = false;
  for (var xi = -6; xi <= 6; xi += 0.04) {
    var yi = fn(xi);
    if (isNaN(yi) || Math.abs(yi) > 6) { st = false; continue; }
    var s = toScreen(xi, yi);
    if (!st) { ctx.moveTo(s.sx, s.sy); st = true; } else ctx.lineTo(s.sx, s.sy);
  }
  ctx.stroke();
}

// Transformation 1: y = (x-t)^2  — horizontal shift
drawCurve(function(x) { return (x - t) * (x - t); }, '#4fc3f7');
// Transformation 2: y = x^2 + t  — vertical shift
drawCurve(function(x) { return x * x + t; }, '#ff8a65');
// Transformation 3: y = |x^2 - 1| — absolute value
drawCurve(function(x) { return Math.abs(x * x - 1); }, '#66bb6a');
// Transformation 4: y = (-x)^2 = x^2 (same for parabola), show y=-x^2 instead
drawCurve(function(x) { return -(x * x); }, '#ef5350');

// Vertices
var v1 = toScreen(t, 0);
var v2 = toScreen(0, t);
ctx.fillStyle = '#4fc3f7';
ctx.beginPath(); ctx.arc(v1.sx, v1.sy, 5, 0, Math.PI*2); ctx.fill();
ctx.fillStyle = '#ff8a65';
if (Math.abs(t) <= 5) {
  ctx.beginPath(); ctx.arc(v2.sx, v2.sy, 5, 0, Math.PI*2); ctx.fill();
}

// Info panel
ctx.fillStyle = 'rgba(0,0,0,0.7)';
ctx.beginPath(); ctx.roundRect(10, 10, 270, 120, 8); ctx.fill();
ctx.fillStyle = 'rgba(255,255,255,0.4)';
ctx.font = '12px sans-serif';
ctx.fillText('基準: y = x²', 18, 30);
ctx.fillStyle = '#4fc3f7'; ctx.font = 'bold 13px monospace';
ctx.fillText('y = (x - ' + t.toFixed(1) + ')²', 18, 52);
ctx.fillStyle = 'rgba(79,195,247,0.6)'; ctx.font = '11px sans-serif';
ctx.fillText('横方向に ' + t.toFixed(1) + ' 移動', 18, 66);
ctx.fillStyle = '#ff8a65'; ctx.font = 'bold 13px monospace';
ctx.fillText('y = x² + ' + t.toFixed(1), 18, 84);
ctx.fillStyle = 'rgba(255,138,101,0.6)'; ctx.font = '11px sans-serif';
ctx.fillText('縦方向に ' + t.toFixed(1) + ' 移動', 18, 98);
ctx.fillStyle = '#66bb6a'; ctx.font = 'bold 13px monospace';
ctx.fillText('y = |x² - 1|', 18, 116);

// Legend on right
ctx.fillStyle = 'rgba(0,0,0,0.6)';
ctx.beginPath(); ctx.roundRect(W - 175, H - 60, 163, 48, 6); ctx.fill();
ctx.fillStyle = '#4fc3f7'; ctx.font = '12px sans-serif';
ctx.fillText('— y=(x-t)² 平行移動', W - 165, H - 42);
ctx.fillStyle = '#ff8a65';
ctx.fillText('— y=x²+t 平行移動', W - 165, H - 26);
ctx.fillStyle = '#ef5350';
ctx.fillText('— y=-x² x 軸対称', W - 165, H - 10);

requestAnimationFrame(loop);
}
loop();

各変換の詳細

① 平行移動

「住所をずらす」——グラフの形を変えずに、場所だけ動かします。

y=f(xa)+by = f(x - a) + b

xx 方向に +a+ayy 方向に +b+b

y=x2y = x^2y=(x3)2+2y = (x-3)^2 + 2(右3・上2)——「頂点が (0,0)(0,0) から (3,2)(3,2) に移動する」


② 対称移動

「鏡に映す」——どの鏡(xx 軸・yy 軸・原点)で反射させるかで公式が変わります。

変換意味
y=f(x)y = -f(x)xx 軸対称——「yy の符号を逆にする」
y=f(x)y = f(-x)yy 軸対称——「xx の符号を逆にして入力する」
y=f(x)y = -f(-x)原点対称——「両方の符号を逆にする」

③ 絶対値変換

「マイナスの部分をプラスに折り返す」——グラフの一部が鏡のように反転します。

y=f(x)y = \lvert f(x) \rvertf(x)<0f(x) < 0 の部分を xx 軸に関して折り返す——「xx 軸の下にある部分が上に跳ね返る」

y=f(x)y = f(\lvert x \rvert)x0x \geq 0 の部分を yy 軸に関して折り返す——「右半分を左にコピーする」


y=xy = |x| のグラフ

y=x={x(x0)x(x<0)y = |x| = \begin{cases} x & (x \geq 0) \\ -x & (x < 0) \end{cases}

V字型のグラフで、(0,0)(0,0) が頂点。y=xy = xy=xy = -x を合わせた形——「右半分は右上がりの直線、左半分は右下がりの直線」です。


練習問題

  1. y=x2y = x^2 を「右2、下3」移動したグラフの式を求めよ。
  2. y=xy = \sqrt{x} のグラフを yy 軸対称移動したグラフの式を求め、定義域も答えよ。
  3. y=x24y = x^2 - 4 のグラフを y=x24y = |x^2 - 4| に変換したとき、変化する部分を説明せよ。
  4. y=2(x1)2+3y = -2(x-1)^2 + 3 のグラフの頂点・軸・開口方向を答えよ。

解答

  1. y=(x2)23y = (x-2)^2 - 3
  2. y=xy = \sqrt{-x}(定義域:x0x \leq 0
  3. 2<x<2-2 < x < 2 の部分(x24<0x^2 - 4 < 0 の部分)が xx 軸の下から上に折り返される
  4. 頂点 (1,3)(1, 3)、軸 x=1x = 1、上に凸(a=2<0a = -2 < 0

まとめ

グラフ変換は以下の順で理解しましょう——「どんな操作をしたか」を一つずつ確認するのが確実です:

  1. 平行移動xax-a(右)、+b+b(上)——「括弧の中を引いたら右、足したら左」
  2. 対称移動f-fxx軸)、f(x)f(-x)yy軸)、f(x)-f(-x)(原点)——「どの軸で折るかで符号が変わる」
  3. 伸縮af(x)af(x)yy方向)、f(ax)f(ax)xx方向圧縮)——「yy 方向は外の係数、xx 方向は中の係数」
  4. 絶対値f(x)|f(x)|(下部を折り返し)、f(x)f(|x|)(右半分を折り返し)——「どちらを折るかが違う」

次回は関数とグラフを使って方程式・不等式を視覚的に解く方法を学びます。「式を解く」ではなく「グラフの交点を探す」という視点の転換が鍵です。