#08 ふれてみよう高校数学 関数
三角関数の合成
三角関数の合成とは
音楽のスピーカーから複数の楽器の音が同時に鳴るとき、空気の振動はすべての音が「足し合わさった」波になっています。「 の波」と「 の波」が混ざり合うとき、それは一つの「ずれたsin波」として表せます——これが三角関数の合成(または波の合成)です。
のような「 と の和」は、1つの 関数にまとめることができます。
ここで
( のとき )
「振幅 と位相ずれ の一つのsin波になる」——2つの違う波が、一つの「きれいな波」にまとまります。
合成の導出
「なぜこんな形になるの?」——加法定理を逆に使うだけです。
加法定理の展開:
これを と比較すると、 の係数同士、 の係数同士を対応させます:
両辺を2乗して加えると —— を使うと:
「直角三角形の斜辺が 、横が 、縦が 」——まるでピタゴラスの定理そのままです。
インタラクティブデモ:2つの波の合成
マウスを左右に動かすと の比率が変わります。 薄い青が 、薄い緑が 、明るい黄色が合成波 です。黄色の波の振幅(点線で表示)が に等しくなっていることを確認してください。
マウスを左右に動かすと a:b の比が変わります
function loop() {
ctx.clearRect(0, 0, W, H);
var ox = W / 2, oy = H / 2 + 10;
var scaleX = 50, scaleY = 65;
var ratio = mx / W;
var a = 2 * Math.cos(ratio * Math.PI);
var b = 2 * Math.sin(ratio * Math.PI);
var R = Math.sqrt(a * a + b * b);
var phi = Math.atan2(b, a);
function toScreen(x, y) {
return { sx: ox + x * scaleX, sy: oy - y * scaleY };
}
// Grid
ctx.strokeStyle = 'rgba(255,255,255,0.06)';
ctx.lineWidth = 1;
for (var gi = -4; gi <= 4; gi++) {
var gs = toScreen(gi * Math.PI, 0);
ctx.beginPath(); ctx.moveTo(gs.sx, 0); ctx.lineTo(gs.sx, H); ctx.stroke();
}
for (var gy2 = -2; gy2 <= 2; gy2++) {
var gs2 = toScreen(0, gy2);
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
ctx.fillStyle = 'rgba(255,255,255,0.4)';
ctx.font = '12px sans-serif';
var plbls = [[-2,'-2π'],[-1,'-π'],[1,'π'],[2,'2π']];
for (var li = 0; li < plbls.length; li++) {
var ls = toScreen(plbls[li][0] * Math.PI, 0);
ctx.fillText(plbls[li][1], ls.sx - 8, oy + 16);
}
var range = W / (2 * scaleX);
// a*sin(x) - dim blue
ctx.strokeStyle = 'rgba(79,195,247,0.4)';
ctx.lineWidth = 1.5;
ctx.beginPath();
for (var xi = -range; xi <= range; xi += 0.03) {
var s = toScreen(xi, a * Math.sin(xi));
if (xi === -range) ctx.moveTo(s.sx, s.sy); else ctx.lineTo(s.sx, s.sy);
}
ctx.stroke();
// b*cos(x) - dim green
ctx.strokeStyle = 'rgba(102,187,106,0.4)';
ctx.lineWidth = 1.5;
ctx.beginPath();
for (var xi3 = -range; xi3 <= range; xi3 += 0.03) {
var s3 = toScreen(xi3, b * Math.cos(xi3));
if (xi3 === -range) ctx.moveTo(s3.sx, s3.sy); else ctx.lineTo(s3.sx, s3.sy);
}
ctx.stroke();
// Combined R*sin(x+phi) - bright yellow
ctx.strokeStyle = '#ffeb3b';
ctx.lineWidth = 3;
ctx.beginPath();
for (var xi4 = -range; xi4 <= range; xi4 += 0.03) {
var s4 = toScreen(xi4, R * Math.sin(xi4 + phi));
if (xi4 === -range) ctx.moveTo(s4.sx, s4.sy); else ctx.lineTo(s4.sx, s4.sy);
}
ctx.stroke();
// Amplitude R dotted lines
ctx.strokeStyle = 'rgba(255,235,59,0.25)';
ctx.lineWidth = 1;
ctx.setLineDash([4,4]);
ctx.beginPath(); ctx.moveTo(0, toScreen(0,R).sy); ctx.lineTo(W, toScreen(0,R).sy); ctx.stroke();
ctx.beginPath(); ctx.moveTo(0, toScreen(0,-R).sy); ctx.lineTo(W, toScreen(0,-R).sy); ctx.stroke();
ctx.setLineDash([]);
ctx.fillStyle = 'rgba(255,235,59,0.6)';
ctx.font = '12px sans-serif';
ctx.fillText('R=' + R.toFixed(2), ox + 4, toScreen(0,R).sy - 4);
// Info panel
ctx.fillStyle = 'rgba(0,0,0,0.65)';
ctx.beginPath(); ctx.roundRect(10, 10, 270, 95, 8); ctx.fill();
ctx.fillStyle = '#4fc3f7';
ctx.font = '12px monospace';
ctx.fillText('a·sinθ: a = ' + a.toFixed(2), 18, 32);
ctx.fillStyle = '#66bb6a';
ctx.fillText('b·cosθ: b = ' + b.toFixed(2), 18, 50);
ctx.fillStyle = '#ffeb3b';
ctx.font = 'bold 13px monospace';
ctx.fillText('R = √(a²+b²) = ' + R.toFixed(3), 18, 70);
var phiDeg = (phi * 180 / Math.PI).toFixed(1);
ctx.fillStyle = 'rgba(255,255,255,0.7)';
ctx.font = '12px monospace';
ctx.fillText('φ = ' + phiDeg + '°, R·sin(θ+φ)', 18, 90);
// Legend
ctx.fillStyle = 'rgba(0,0,0,0.5)';
ctx.beginPath(); ctx.roundRect(W - 195, H - 60, 183, 48, 6); ctx.fill();
ctx.fillStyle = '#4fc3f7'; ctx.font = '12px sans-serif';
ctx.fillText('— a·sinθ', W - 185, H - 40);
ctx.fillStyle = '#66bb6a';
ctx.fillText('— b·cosθ', W - 185, H - 24);
ctx.fillStyle = '#ffeb3b';
ctx.fillText('— R·sin(θ+φ) [合成波]', W - 185, H - 8);
requestAnimationFrame(loop);
}
loop(); 手順のまとめ
を合成する
「横3、縦4の直角三角形の斜辺を計算する」——ピタゴラスの定理で が出てきます。
手順① を計算:
手順② を計算: →
手順③ 合成:
「3と4から5が出てくる」——有名な「3-4-5の直角三角形」と同じです。
合成の応用:最大・最小
合成形 の形にすると、最大値・最小値が一目でわかります。sinの値域は なので:
なので の:
- 最大値:
- 最小値:
「どんなにsinとcosが混ざっていても、最大値はかならず 」——これが合成の最大の便利さです。
例
の最大値・最小値を求めよ。
最大値 、最小値 。
練習問題
- を の形に合成せよ。
- の最大値と、そのときの ()を求めよ。
- を解け()。
解答
- 、 → 。合成:
- 、。最大値 ( → )
- → →
まとめ
- は合成波の振幅——「ピタゴラスの定理で計算する」
- 最大値 、最小値 ——「合成すれば一目でわかる」
- 合成すると最大・最小や方程式の解が求めやすくなる
次回は指数関数を学びます。「」という式が表す爆発的な増加と、自然界の成長・減衰を記述する不思議な数 の話です。