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

三角関数のグラフ

三角関数のグラフの基本

ラジオやスピーカーから音が出るとき、空気の振動は「波」の形をしています。海の波、電気の交流、心拍計のグラフ——これらすべてが sinやcosが描く周期的な波の形です。三角関数のグラフを理解することで、「繰り返す現象」を数式で表せるようになります。

それぞれの基本的な性質を整理します。

y=sinxy = \sin x

性質
周期2π2\pi
振幅11
値域1y1-1 \leq y \leq 1
零点x=nπx = n\pinn は整数)

「周期が 2π2\pi」とは、角度にして360°分進むと元の形に戻るということ——時計の針が1周したら同じ場所に戻るのと同じです。

y=cosxy = \cos x

cosx=sin ⁣(x+π2)\cos x = \sin\!\left(x + \dfrac{\pi}{2}\right) なので、sin\sin グラフを左に π2\dfrac{\pi}{2} だけ平行移動したものです。

「sinを90°だけ前にずらすとcos」——同じ形の波が少しだけタイミングをずらしているだけです。

y=tanxy = \tan x

性質
周期π\pi
値域すべての実数
漸近線x=π2+nπx = \dfrac{\pi}{2} + n\pi

tanは sin÷cos\sin \div \cos なので、cos=0\cos = 0 になる角度(90°、270°…)では分母がゼロになって定義できません——「割り算でゼロ割り禁止」のルールが生む「壁」です。


インタラクティブデモ:位相シフトを体感しよう

y=Asin(Bx+C)y = A\sin(Bx + C) の形で、マウスを左右に動かすと位相 CC が変わります。青が sin\sin、緑が cos\cos です。2つの波がどのような関係にあるかを観察してください——マウスをある位置に動かすと、青い波と緑の波がぴったり重なる瞬間があります。それが「sinとcosは90°ずれた同じ波」ということの視覚的な証拠です。

マウスを左右に動かすと sin 波の位相がシフトします
function loop() {
ctx.clearRect(0, 0, W, H);

var ox = W / 2, oy = H / 2 + 10;
var scaleX = 50, scaleY = 70;
var phase = (mx / W) * Math.PI * 2;

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

// Grid (pi intervals)
ctx.strokeStyle = 'rgba(255,255,255,0.07)';
ctx.lineWidth = 1;
var piStep = Math.PI;
for (var gi = -4; gi <= 4; gi++) {
  var gx = gi * piStep;
  var gs = toScreen(gx, 0);
  ctx.beginPath(); ctx.moveTo(gs.sx, 0); ctx.lineTo(gs.sx, H); ctx.stroke();
}
for (var gy = -1.5; gy <= 1.5; gy += 0.5) {
  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();

// Pi labels on x-axis
ctx.fillStyle = 'rgba(255,255,255,0.45)';
ctx.font = '12px sans-serif';
var piLabels = [[-2, '-2π'], [-1, '-π'], [1, 'π'], [2, '2π']];
for (var li = 0; li < piLabels.length; li++) {
  var ls = toScreen(piLabels[li][0] * Math.PI, 0);
  ctx.fillText(piLabels[li][1], ls.sx - 8, oy + 16);
}
ctx.fillText('0', ox + 4, oy + 16);
ctx.fillText('1', ox + 4, toScreen(0, 1).sy - 2);
ctx.fillText('-1', ox + 4, toScreen(0, -1).sy + 12);

// cos curve (green, behind)
ctx.strokeStyle = 'rgba(102,187,106,0.6)';
ctx.lineWidth = 2;
ctx.beginPath();
var range = W / (2 * scaleX);
for (var xi = -range; xi <= range; xi += 0.03) {
  var yi = Math.cos(xi);
  var s = toScreen(xi, yi);
  if (xi === -range) ctx.moveTo(s.sx, s.sy); else ctx.lineTo(s.sx, s.sy);
}
ctx.stroke();

// sin curve with phase (blue)
ctx.strokeStyle = '#4fc3f7';
ctx.lineWidth = 2.5;
ctx.beginPath();
for (var xi2 = -range; xi2 <= range; xi2 += 0.03) {
  var yi2 = Math.sin(xi2 + phase);
  var s2 = toScreen(xi2, yi2);
  if (xi2 === -range) ctx.moveTo(s2.sx, s2.sy); else ctx.lineTo(s2.sx, s2.sy);
}
ctx.stroke();

// Phase indicator arrow
var phaseX = -phase;
var sPh = toScreen(phaseX, 0);
ctx.fillStyle = 'rgba(255,235,59,0.8)';
ctx.beginPath(); ctx.arc(sPh.sx, oy, 5, 0, Math.PI * 2); ctx.fill();
ctx.strokeStyle = '#ffeb3b';
ctx.lineWidth = 1.5;
ctx.setLineDash([4, 3]);
ctx.beginPath(); ctx.moveTo(sPh.sx, 0); ctx.lineTo(sPh.sx, H); ctx.stroke();
ctx.setLineDash([]);

// Info panel
ctx.fillStyle = 'rgba(0,0,0,0.65)';
ctx.beginPath(); ctx.roundRect(10, 10, 260, 80, 8); ctx.fill();
ctx.fillStyle = '#4fc3f7';
ctx.font = 'bold 13px monospace';
var phaseDeg = (phase * 180 / Math.PI).toFixed(1);
ctx.fillText('y = sin(x + ' + phaseDeg + '°)', 18, 34);
ctx.fillStyle = '#66bb6a';
ctx.font = '13px monospace';
ctx.fillText('y = cos(x)  [参照]', 18, 56);
ctx.fillStyle = 'rgba(255,235,59,0.9)';
ctx.font = '12px sans-serif';
ctx.fillText('位相シフト C = ' + phaseDeg + '°', 18, 76);

// Legend
ctx.fillStyle = 'rgba(0,0,0,0.5)';
ctx.beginPath(); ctx.roundRect(W - 160, H - 50, 148, 38, 6); ctx.fill();
ctx.fillStyle = '#4fc3f7'; ctx.font = '13px sans-serif';
ctx.fillText('— sin(x+C)', W - 150, H - 30);
ctx.fillStyle = '#66bb6a';
ctx.fillText('— cos(x)', W - 150, H - 14);

requestAnimationFrame(loop);
}
loop();

一般形のグラフ変換

実際の音や振動では「振幅が大きい(音が大きい)」「周期が短い(高音)」「タイミングがずれている(位相が違う)」など、いろいろなパターンがあります。これらを一つの式で表したのが:

y=Asin(Bx+C)+Dy = A\sin(Bx + C) + D
パラメータ意味変化
AA振幅縦方向の伸縮
BB角振動数周期 T=2πBT = \dfrac{2\pi}{\lvert B \rvert}
CC初期位相横方向の移動(C/B-C/B だけ平行移動)
DD直流成分縦方向の移動

たとえば A=3A = 3 なら波の高さが3倍、B=2B = 2 なら同じ幅に2回波が入る(周期が半分)、D=1D = 1 なら波全体が1だけ上にずれる——それぞれが独立した「つまみ」を回すようなイメージです。


tan\tan 関数のグラフ

y=tanxy = \tan xx=±π2,±3π2,x = \pm\dfrac{\pi}{2}, \pm\dfrac{3\pi}{2}, \ldots で定義されず、これらが漸近線になります。

グラフは各区間 (π2,π2)\left(-\dfrac{\pi}{2}, \dfrac{\pi}{2}\right)-\infty から ++\infty へ単調増加します。

「ハシゴを上から下まで全部通る」ような形が、縦の壁(漸近線)で区切られながら繰り返されます——sinやcosのような「丸い波」とは全然違う、鋭いS字形の曲線です。


周期・振幅・位相のまとめ

例:y=3sin ⁣(2xπ3)+1y = 3\sin\!\left(2x - \dfrac{\pi}{3}\right) + 1

まず B=2B = 2C=π3C = -\dfrac{\pi}{3} と読み取り、一つひとつ確認します——「数字を読んで意味に変換する」作業です。

  • 振幅:3=3|3| = 3(波の高さが3倍——最大値が4、最小値が-2)
  • 周期:T=2π2=πT = \dfrac{2\pi}{2} = \pi(通常の半分の幅で1周する)
  • 位相:π/32=π6-\dfrac{\pi/3}{2} = -\dfrac{\pi}{6}(右に π6\dfrac{\pi}{6} 移動——波の開始が少し遅れる)
  • 中心線:y=1y = 1(波全体が1だけ上にずれている)

練習問題

  1. y=2sin3xy = 2\sin 3x の振幅と周期を求めよ。
  2. y=cos ⁣(xπ4)y = \cos\!\left(x - \dfrac{\pi}{4}\right)y=cosxy = \cos x をどの向きに何だけ移動したグラフか。
  3. y=sinxy = -\sin x のグラフを描け。(y=sinxy = \sin x との関係を述べよ)

解答

  1. 振幅 22、周期 2π3\dfrac{2\pi}{3}
  2. 右に π4\dfrac{\pi}{4} 平行移動
  3. xx 軸に関して対称な鏡像(折り返したグラフ)

まとめ

  • sin,cos\sin, \cos の周期は 2π2\pi、振幅は 11——「360°で1回転して戻ってくる」
  • tan\tan の周期は π\pi、漸近線あり——「sinをcosで割るから、cosがゼロの場所で壁ができる」
  • y=Asin(Bx+C)+Dy = A\sin(Bx+C)+D で4つのパラメータが形を決める——「振幅・周期・タイミング・高さの4つのつまみ」
  • cosθ=sin ⁣(θ+π2)\cos\theta = \sin\!\left(\theta + \dfrac{\pi}{2}\right)——「cosはsinを90°前倒しにしたもの」

次回は加法定理を学びます。「sin(A+B)\sin(A+B) はどう展開するのか?」——三角関数の計算で最も重要な公式の一つです。