Triangle Length
Find the missing side length of a triangle from two known sides and the included angle using the law of cosines (SAS). Free online geometry calculator with instant results.
About This Calculator
The triangle length calculator computes the missing side length of any triangle when you know two side lengths and the included angle between them. This is known as the SAS (side-angle-side) case in triangle geometry. Using the law of cosines, the calculator instantly finds the third side, making it an essential tool for geometry students, engineers, architects, carpenters, and anyone working with triangles in real-world applications.
The law of cosines is a fundamental trigonometric rule that generalizes the Pythagorean theorem to any triangle. For a triangle with sides a, b, c where angle C is the angle between sides a and b, the formula is: c^2 = a^2 + b^2 - 2ab·cos(C). To find side c, we take the square root: c = sqrt(a^2 + b^2 - 2ab·cos(C)). The included angle C must be entered in degrees; the calculator automatically converts it to radians for the cosine computation. This formula works for all triangle types -- when C = 90 deg, cos(90 deg) = 0 and the formula simplifies to the familiar Pythagorean theorem c = sqrt(a^2 + b^2). When C > 90 deg, the cosine is negative and the formula still produces the correct result, demonstrating the law's universal applicability.
This triangle length solver has numerous practical applications across fields and education. In construction and carpentry, it helps determine diagonal bracing lengths, roof rafter dimensions, and truss member sizes. Surveyors use it to calculate distances across inaccessible terrain by measuring two accessible sides and the angle between them. Engineers apply it in structural analysis, mechanical linkage design, and robotics kinematics. In navigation and GPS systems, the law of cosines helps calculate great-circle distances between points on the Earth's surface.
The law of cosines and triangle geometry are standard topics in mathematics curricula worldwide. Students in India (CBSE, ICSE), the United States (Common Core standards), and the United Kingdom (GCSE and A-Level) learn the law of cosines as part of their trigonometry and geometry coursework. The calculator works with any consistent unit of measurement -- centimeters, meters, inches, feet, or kilometers -- since the formula only requires relative proportions. The included angle must always be provided in degrees, which is the standard unit taught in classrooms globally.
Frequently Asked Questions
What is the law of cosines and how does it find missing triangle sides?
The law of cosines states that c^2 = a^2 + b^2 - 2ab·cos(C), where a and b are two known sides, C is the included angle between them, and c is the opposite side. This formula extends the Pythagorean theorem to any triangle -- acute, right, or obtuse. Simply enter your two side lengths and the included angle into the triangle length calculator to instantly compute the missing third side.
Can I use this calculator for any type of triangle?
Yes, the law of cosines works for all triangles -- acute, right, or obtuse. Whether you have an equilateral triangle, an isosceles triangle, or a scalene triangle, entering two sides and the included angle (SAS) will correctly compute the third side. The formula handles all cases because the cosine function naturally accounts for angles greater than 90 deg with negative values.
What if I know two sides but not the included angle?
If you know two sides but not the included angle, you cannot directly use the law of cosines to find the third side. You would need additional information such as the angle opposite one of the known sides (SSA case) or all three sides (SSS) to compute angles. For these scenarios, try our triangle side calculator or triangle degree calculator on Calculy.
How accurate are the triangle length results?
The calculator uses JavaScript's standard Math.cos and Math.sqrt functions, providing results accurate to at least 10 decimal places. Results are displayed rounded to 2 decimal places for readability. The underlying law of cosines formula is mathematically exact, so the accuracy depends entirely on the precision of your input measurements.
Can I use this calculator for right triangles?
Yes, for a right triangle with the included angle C = 90 deg, cos(90 deg) = 0, so the law of cosines simplifies to the Pythagorean theorem: c = sqrt(a^2 + b^2). This means you can also use this calculator as a right triangle hypotenuse finder by entering sides a and b and angle 90 deg. For dedicated right triangle tools, check our right triangle side and angle calculator.
Is this calculator useful for students and professionals?
Absolutely. Students learning geometry and trigonometry (CBSE, ICSE, Common Core, GCSE, A-Level) can verify homework and understand the law of cosines through practical examples. Engineers, architects, carpenters, surveyors, and construction professionals use it daily to find unknown lengths in roof trusses, bridges, frames, and land surveys without manual trigonometric calculations.
What units does the triangle length calculator support?
The calculator works with any unit of measurement -- centimeters, meters, inches, feet, or miles -- because the law of cosines is unit-agnostic. Simply enter all values in the same unit and the result will be in that same unit. For example, enter sides in meters to get the third side in meters. The angle must be entered in degrees.