#03 ふれてみよう高校数学 幾何と図形
正弦定理・余弦定理
直角三角形を超えて
たとえば、三角形の土地を持っているとします。3辺の長さはわかっているけれど、各角の大きさはわからない——こんなときに役立つのが今回学ぶ定理です。
前回まで学んだ三角比は直角三角形が前提でした。しかし現実の問題では、直角とは限らない一般の三角形を扱う必要があります。そこで登場するのが正弦定理と余弦定理です。
三角形 ABC において、辺 はそれぞれ角 の対辺とします(小文字 = 対辺、大文字 = 角)。
正弦定理
は三角形の外接円の半径です。
正弦定理の意味
直感的に言えば:「辺の長さ」と「その角の sin」の比は、どの辺でも同じです。さらに、その共通の値は外接円の直径になります。
- 辺の長さと対角の sin の比はどの辺でも等しい
- その共通の値はちょうど外接円の直径
- 「大きい角の対辺は長い」という日常的な直感と整合する
使い場面
「辺と角の情報が混ざっている」問題では正弦定理が活躍します。
| わかっていること | 求めたいもの |
|---|---|
| 二辺とその対角 | もう一方の角(例: → ) |
| 一辺と二つの角 | 残りの辺(例: → ) |
| 任意の一辺と対角 | 外接円の半径 |
インタラクティブ図解①:正弦定理と外接円
三角形の各辺/sinA の値がすべて等しく、外接円の直径 2R になることを確認してみましょう。マウスで三角形の形を変えても、この比は一定です。
頂点をマウスで追いかけると三角形が変形する。a/sinA は常に 2R に等しい
var cx = 300, cy = 170, R = 120;
var angleA = Math.PI * 0.5;
var angleB = Math.PI * (0.5 + 2/3);
var angleC = Math.PI * (0.5 + 4/3);
function loop() {
ctx.clearRect(0, 0, W, H);
// マウスで angleB を動かす
angleB = Math.PI * 0.5 + ((mx / W) * Math.PI * 1.6 - Math.PI * 0.2);
angleC = angleB + Math.PI * 2 / 3;
var ax = cx + R * Math.cos(angleA), ay = cy - R * Math.sin(angleA);
var bx = cx + R * Math.cos(angleB), by = cy - R * Math.sin(angleB);
var ccx = cx + R * Math.cos(angleC), ccy = cy - R * Math.sin(angleC);
// 外接円
ctx.beginPath();
ctx.arc(cx, cy, R, 0, Math.PI * 2);
ctx.strokeStyle = '#30363d';
ctx.lineWidth = 1.5;
ctx.stroke();
// 三角形
ctx.beginPath();
ctx.moveTo(ax, ay);
ctx.lineTo(bx, by);
ctx.lineTo(ccx, ccy);
ctx.closePath();
ctx.strokeStyle = '#58a6ff';
ctx.lineWidth = 2.5;
ctx.stroke();
ctx.fillStyle = '#58a6ff10';
ctx.fill();
// 辺 a (BC の対辺、A の対辺)
var a = Math.sqrt(Math.pow(bx - ccx, 2) + Math.pow(by - ccy, 2));
var b = Math.sqrt(Math.pow(ax - ccx, 2) + Math.pow(ay - ccy, 2));
var c = Math.sqrt(Math.pow(ax - bx, 2) + Math.pow(ay - by, 2));
// 角 A の計算(余弦定理)
var cosA = (b * b + c * c - a * a) / (2 * b * c);
cosA = Math.max(-1, Math.min(1, cosA));
var sinA = Math.sqrt(1 - cosA * cosA);
var angleAval = Math.asin(sinA) * 180 / Math.PI;
var cosB = (a * a + c * c - b * b) / (2 * a * c);
cosB = Math.max(-1, Math.min(1, cosB));
var sinB = Math.sqrt(1 - cosB * cosB);
var cosC2 = (a * a + b * b - c * c) / (2 * a * b);
cosC2 = Math.max(-1, Math.min(1, cosC2));
var sinC2 = Math.sqrt(1 - cosC2 * cosC2);
var ratio1 = sinA > 0.01 ? (a / sinA).toFixed(2) : '—';
var ratio2 = sinB > 0.01 ? (b / sinB).toFixed(2) : '—';
var ratio3 = sinC2 > 0.01 ? (c / sinC2).toFixed(2) : '—';
var twoR = (2 * R).toFixed(2);
// 頂点ラベル
ctx.font = 'bold 15px serif';
ctx.fillStyle = '#f0883e';
ctx.fillText('A', ax - 10, ay - 10);
ctx.fillStyle = '#56d364';
ctx.fillText('B', bx - 16, by + 4);
ctx.fillStyle = '#bc8cff';
ctx.fillText('C', ccx + 6, ccy + 4);
// 頂点点
[[ax,ay,'#f0883e'],[bx,by,'#56d364'],[ccx,ccy,'#bc8cff']].forEach(function(p) {
ctx.beginPath(); ctx.arc(p[0], p[1], 5, 0, Math.PI*2);
ctx.fillStyle = p[2]; ctx.fill();
});
// 中心点
ctx.beginPath(); ctx.arc(cx, cy, 4, 0, Math.PI*2);
ctx.fillStyle = '#ffa657'; ctx.fill();
// パネル
ctx.fillStyle = '#0d1117cc';
ctx.fillRect(10, 10, 200, 120);
ctx.strokeStyle = '#30363d'; ctx.lineWidth = 1;
ctx.strokeRect(10, 10, 200, 120);
ctx.font = 'bold 12px monospace';
ctx.fillStyle = '#e6edf3';
ctx.fillText('a/sinA = ' + ratio1, 20, 32);
ctx.fillText('b/sinB = ' + ratio2, 20, 52);
ctx.fillText('c/sinC = ' + ratio3, 20, 72);
ctx.fillStyle = '#ffa657';
ctx.fillText('2R = ' + twoR, 20, 96);
ctx.fillStyle = '#79c0ff';
ctx.font = '11px sans-serif';
ctx.fillText('すべて等しい!', 20, 116);
requestAnimationFrame(loop);
}
loop();
余弦定理
同様に、
ピタゴラスの定理との関係
「ピタゴラスの定理は直角三角形専用」でしたが、余弦定理はあらゆる三角形で使えます。 のとき なので:
余弦定理はピタゴラスの定理の一般化です。 の項は「直角からのズレ」を補正するものです。
- (鋭角): なので ( が小さくなる方向)——角が小さければ対辺も短くなる
- (鈍角): なので ( が大きくなる方向)——角が大きければ対辺も長くなる
使い場面
「辺の情報が多い」問題では余弦定理が活躍します。
| わかっていること | 求めたいもの |
|---|---|
| 二辺と挟む角 | 第三辺(例: → ) |
| 三辺すべて | 各角(例: → ) |
インタラクティブ図解②:余弦定理の視覚化
角 C を変えると辺 c の長さがどう変わるか確認しましょう。 のとき (ピタゴラスの定理と一致)になっていることも確認できます。
マウスを左右に動かして角 C を変える。c² の値が a²+b²-2ab·cosC に従う
function loop() {
ctx.clearRect(0, 0, W, H);
var a = 120, b = 90;
// 角 C: 10° to 170°
var C = 10 + (mx / W) * 160;
var Crad = C * Math.PI / 180;
// 頂点 C を原点に
var cx = 160, cy = 220;
var ax = cx + b * Math.cos(0), ay = cy;
var bx = cx + a * Math.cos(Crad), by = cy - a * Math.sin(Crad);
// 辺 c
var c = Math.sqrt(a*a + b*b - 2*a*b*Math.cos(Crad));
// 三角形
ctx.beginPath();
ctx.moveTo(cx, cy);
ctx.lineTo(ax, ay);
ctx.lineTo(bx, by);
ctx.closePath();
ctx.fillStyle = '#58a6ff10';
ctx.fill();
// 辺 a (C→B)
ctx.beginPath(); ctx.moveTo(cx, cy); ctx.lineTo(bx, by);
ctx.strokeStyle = '#f0883e'; ctx.lineWidth = 3; ctx.stroke();
// 辺 b (C→A)
ctx.beginPath(); ctx.moveTo(cx, cy); ctx.lineTo(ax, ay);
ctx.strokeStyle = '#56d364'; ctx.lineWidth = 3; ctx.stroke();
// 辺 c (A→B)
ctx.beginPath(); ctx.moveTo(ax, ay); ctx.lineTo(bx, by);
ctx.strokeStyle = '#bc8cff'; ctx.lineWidth = 3; ctx.stroke();
// 角 C の弧
ctx.beginPath();
ctx.arc(cx, cy, 28, -Crad, 0);
ctx.strokeStyle = '#ffa657'; ctx.lineWidth = 2; ctx.stroke();
// ラベル
ctx.font = 'bold 14px serif';
ctx.fillStyle = '#ffa657';
ctx.fillText('C=' + C.toFixed(0) + '°', cx + 32, cy - 8);
ctx.fillStyle = '#f0883e';
ctx.fillText('a=' + a, cx + (bx-cx)/2 - 28, cy + (by-cy)/2 - 4);
ctx.fillStyle = '#56d364';
ctx.fillText('b=' + b, cx + (ax-cx)/2 - 10, cy + 16);
ctx.fillStyle = '#bc8cff';
ctx.fillText('c=' + c.toFixed(1), (ax+bx)/2 + 8, (ay+by)/2 - 6);
ctx.font = 'bold 14px serif';
ctx.fillStyle = '#f0883e';
ctx.fillText('A', bx + 6, by - 6);
ctx.fillStyle = '#56d364';
ctx.fillText('B', ax + 6, ay - 8);
ctx.fillStyle = '#bc8cff';
ctx.fillText('C', cx - 18, cy + 4);
// 計算パネル
ctx.fillStyle = '#0d1117cc';
ctx.fillRect(W - 240, 10, 228, 120);
ctx.strokeStyle = '#30363d'; ctx.lineWidth = 1;
ctx.strokeRect(W - 240, 10, 228, 120);
ctx.font = '12px monospace';
ctx.fillStyle = '#e6edf3';
ctx.fillText('a² + b² = ' + (a*a + b*b), W-230, 30);
ctx.fillStyle = '#ffa657';
ctx.fillText('2ab·cosC = ' + (2*a*b*Math.cos(Crad)).toFixed(1), W-230, 50);
ctx.fillStyle = '#bc8cff';
ctx.fillText('c² = ' + (c*c).toFixed(1), W-230, 70);
ctx.fillStyle = '#79c0ff';
ctx.fillText('c = ' + c.toFixed(2), W-230, 90);
var pythag = Math.sqrt(a*a + b*b);
ctx.fillStyle = '#8b949e';
ctx.font = '11px monospace';
ctx.fillText('(直角なら c=' + pythag.toFixed(1) + ')', W-230, 112);
requestAnimationFrame(loop);
}
loop();
例題
例題 1(正弦定理)
三角形 ABC で 、、 のとき、辺 と外接円の半径 を求めよ。
解法:
まず (三角形の内角の和は180°)
正弦定理より:
外接円の半径:
例題 2(余弦定理)
、、 のとき、辺 を求めよ。
解法:
「2辺と挟む角がわかっている」→ 余弦定理で第3辺を求めます。
正弦定理 vs 余弦定理の使い分け
迷ったときは「辺と角のペアがあるか?」を確認しましょう。
| 状況 | 使う定理 |
|---|---|
| 辺と対角がペアで与えられている | 正弦定理(辺/sinA の比を使う) |
| 二辺と挟む角 | 余弦定理(辺を求める) |
| 三辺が与えられている | 余弦定理(角を求める) |
| 外接円の半径を求める | 正弦定理 |
まとめ
- 正弦定理:(外接円の直径と等しい)
- 余弦定理:(ピタゴラスの定理を一般の三角形に拡張)
- のとき余弦定理がピタゴラスの定理になる——両者は同じ「家族」です
- 「辺と角のペアがある → 正弦定理」「辺ばかり or 辺と挟む角 → 余弦定理」と使い分ける
次回は平面における「直線の方程式」を学び、座標幾何の世界に入ります。