Triangle Calculator
Solve any triangle given sides and angles (SSS, SAS, ASA, AAS). Get area and perimeter.
About this tool
A triangle calculator solves one of the most fundamental geometry problems: finding unknown sides and angles when you have partial information. Whether you're working on construction blueprints, engineering designs, surveying land, or solving homework problems, knowing how to calculate triangle properties quickly saves time and reduces calculation errors. This tool handles all standard triangle scenarios—SSS (three sides), SAS (two sides and an angle), ASA (two angles and a side), and AAS (two angles and another side)—automatically identifying which solver to use.
To use this calculator, simply input the measurements you know (sides in any unit, angles in degrees). The tool processes your data through trigonometric principles (the law of cosines and law of sines) and instantly returns all missing sides, angles, area, and perimeter. For example, if you have one side and two angles, select the AAS mode and enter those values; the calculator works backward from the angle constraints to find the remaining side. The area calculation uses Heron's formula for SSS inputs and the standard ½ab sin(C) formula for angle-based inputs.
This calculator is particularly useful for professionals in construction, surveying, navigation, and physics—contexts where triangles appear constantly—and equally helpful for students verifying manual calculations or building geometric intuition. Keep in mind that some input combinations may produce no valid triangle (impossible measurements) or multiple solutions depending on the configuration; the tool will alert you to these edge cases. For highly specialized applications requiring vectors, coordinate geometry, or 3D triangles, dedicated CAD or engineering software may be more appropriate.
Frequently Asked Questions
Code Implementation
import math
def deg(angle): return math.radians(angle)
def rad(angle): return math.degrees(angle)
# SSS: all three sides known → find angles and area
def solve_sss(a, b, c):
# Law of cosines
A = rad(math.acos((b**2 + c**2 - a**2) / (2*b*c)))
B = rad(math.acos((a**2 + c**2 - b**2) / (2*a*c)))
C = 180 - A - B
# Heron's formula
s = (a + b + c) / 2
area = math.sqrt(s * (s-a) * (s-b) * (s-c))
return A, B, C, area
A, B, C, area = solve_sss(3, 4, 5)
print(f"Angles: {A:.2f}°, {B:.2f}°, {C:.2f}°")
print(f"Area: {area:.4f}")
# SAS: two sides and included angle
def solve_sas(a, b, C_deg):
C = deg(C_deg)
# Law of cosines for third side
c = math.sqrt(a**2 + b**2 - 2*a*b*math.cos(C))
# Law of sines for other angles
A = rad(math.asin(a * math.sin(C) / c))
B = 180 - C_deg - A
area = 0.5 * a * b * math.sin(C)
return c, A, B, area
c, A, B, area = solve_sas(5, 7, 60)
print(f"Side c: {c:.4f}, Angles: {A:.2f}°, {B:.2f}°, Area: {area:.4f}")Comments & Feedback
Comments are powered by Giscus. Sign in with GitHub to leave a comment.