三角関数のグラフ
三角関数のグラフの基本
ラジオやスピーカーから音が出るとき、空気の振動は「波」の形をしています。海の波、電気の交流、心拍計のグラフ——これらすべてが sinやcosが描く周期的な波の形です。三角関数のグラフを理解することで、「繰り返す現象」を数式で表せるようになります。
それぞれの基本的な性質を整理します。
| 性質 | 値 |
|---|---|
| 周期 | |
| 振幅 | |
| 値域 | |
| 零点 | ( は整数) |
「周期が 」とは、角度にして360°分進むと元の形に戻るということ——時計の針が1周したら同じ場所に戻るのと同じです。
なので、 グラフを左に だけ平行移動したものです。
「sinを90°だけ前にずらすとcos」——同じ形の波が少しだけタイミングをずらしているだけです。
| 性質 | 値 |
|---|---|
| 周期 | |
| 値域 | すべての実数 |
| 漸近線 |
tanは なので、 になる角度(90°、270°…)では分母がゼロになって定義できません——「割り算でゼロ割り禁止」のルールが生む「壁」です。
インタラクティブデモ:位相シフトを体感しよう
の形で、マウスを左右に動かすと位相 が変わります。青が 、緑が です。2つの波がどのような関係にあるかを観察してください——マウスをある位置に動かすと、青い波と緑の波がぴったり重なる瞬間があります。それが「sinとcosは90°ずれた同じ波」ということの視覚的な証拠です。
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(); 一般形のグラフ変換
実際の音や振動では「振幅が大きい(音が大きい)」「周期が短い(高音)」「タイミングがずれている(位相が違う)」など、いろいろなパターンがあります。これらを一つの式で表したのが:
| パラメータ | 意味 | 変化 |
|---|---|---|
| 振幅 | 縦方向の伸縮 | |
| 角振動数 | 周期 | |
| 初期位相 | 横方向の移動( だけ平行移動) | |
| 直流成分 | 縦方向の移動 |
たとえば なら波の高さが3倍、 なら同じ幅に2回波が入る(周期が半分)、 なら波全体が1だけ上にずれる——それぞれが独立した「つまみ」を回すようなイメージです。
関数のグラフ
は で定義されず、これらが漸近線になります。
グラフは各区間 で から へ単調増加します。
「ハシゴを上から下まで全部通る」ような形が、縦の壁(漸近線)で区切られながら繰り返されます——sinやcosのような「丸い波」とは全然違う、鋭いS字形の曲線です。
周期・振幅・位相のまとめ
例:
まず 、 と読み取り、一つひとつ確認します——「数字を読んで意味に変換する」作業です。
- 振幅:(波の高さが3倍——最大値が4、最小値が-2)
- 周期:(通常の半分の幅で1周する)
- 位相:(右に 移動——波の開始が少し遅れる)
- 中心線:(波全体が1だけ上にずれている)
練習問題
- の振幅と周期を求めよ。
- は をどの向きに何だけ移動したグラフか。
- のグラフを描け。( との関係を述べよ)
解答
- 振幅 、周期
- 右に 平行移動
- 軸に関して対称な鏡像(折り返したグラフ)
まとめ
- の周期は 、振幅は ——「360°で1回転して戻ってくる」
- の周期は 、漸近線あり——「sinをcosで割るから、cosがゼロの場所で壁ができる」
- で4つのパラメータが形を決める——「振幅・周期・タイミング・高さの4つのつまみ」
- ——「cosはsinを90°前倒しにしたもの」
次回は加法定理を学びます。「 はどう展開するのか?」——三角関数の計算で最も重要な公式の一つです。