📐 Triangle Calculator
Triangle Calculator - Compute perimeter, area (Heron) and angles from three sides, with type detection. Free, browser-only.
📐 工作原理與說明
三角形求解(SSS 已知三邊)
構成條件:任意兩邊之和 > 第三邊(a+b>c、a+c>b、b+c>a)
海倫公式:半周長 s = (a+b+c)/2,面積 = √[s(s−a)(s−b)(s−c)]
餘弦定理求內角:cos A = (b²+c²−a²) ÷ (2bc),A = arccos(…)×180/π
型別判定:任一內角 = 90° 為直角三角形|全 <90° 銳角|否則鈍角
三內角之和恆為 180°
構成條件:任意兩邊之和 > 第三邊(a+b>c、a+c>b、b+c>a)
海倫公式:半周長 s = (a+b+c)/2,面積 = √[s(s−a)(s−b)(s−c)]
餘弦定理求內角:cos A = (b²+c²−a²) ÷ (2bc),A = arccos(…)×180/π
型別判定:任一內角 = 90° 為直角三角形|全 <90° 銳角|否則鈍角
三內角之和恆為 180°
按三角形已知條件求解邊長、角度、面積與周長。
Large-number handling: normalize by the longest side before Heron and cosine calculations, avoiding overflow from squaring 1e160-scale sides. If perimeter or area exceeds the Number range, it is shown in scientific notation while angles and type still use normalized sides.
- 內角和:三角形三個內角之和恆為 180°。
- 勾股定理:直角三角形滿足
a² + b² = c²,c 為斜邊。 - 海倫公式:令
s=(a+b+c)/2,面積= √(s(s−a)(s−b)(s−c)),已知三邊即可求面積。 - 正餘弦定理:
a/sinA = b/sinB = c/sinC;c² = a² + b² − 2ab·cosC。
Formula & Standard References
| Item | Formula / Note | Source / Standard |
|---|---|---|
| Law of cosines | c^2 = a^2 + b^2 - 2ab cos(C) | Euclidean geometry |
| Law of sines | a/sin(A) = b/sin(B) = c/sin(C) = 2R | Euclidean geometry |
| Triangle inequality | sum of any two sides exceeds the third | Euclidean geometry |
⚠️ 使用說明與注意事項
- 海倫公式:面積 = √[s(s−a)(s−b)(s−c)],其中 s 為半周長(周長的一半),對任意三角形都成立。
- 餘弦定理:cos A = (b²+c²−a²)/(2bc),據此反推角度;三個角之和恆為 180°。
- 判斷型別:任一內角≈90° 為直角,三者都<90° 為銳角,否則為鈍角(浮點誤差用 1e-6 容差)。
📋 常用公式
| 量 | 公式 |
|---|---|
| 半周長 s | (a+b+c)/2 |
| 面積 | √[s(s−a)(s−b)(s−c)] |
| 角 A | arccos((b²+c²−a²)/(2bc)) |