Formula and method for the Cosine Triangle Calculator
The Law of Cosines relates the three sides of a triangle to one of its angles: c² = a² + b² − 2ab·cos(C), where C is the angle opposite side c (the angle sandwiched between sides a and b). This calculator uses the SAS (side-angle-side) form: you supply two sides and the angle between them, and it solves for the third side directly from that formula.
How the calculation works
After side c is known, all three sides are known, so the remaining two angles are found by applying the Law of Cosines a second and third time in rearranged form: A = cos⁻¹((b² + c² − a²) / 2bc) and B = cos⁻¹((a² + c² − b²) / 2ac). As a check, A + B + C always equals 180° (π radians) for a valid triangle. The area is found with the trigonometric area formula Area = ½·a·b·sin(C), which needs only two sides and the included angle — no separate height measurement required. Enter both sides in the same unit; the calculated side and area will be in that unit (and that unit squared for area).
Common mistakes
- Using a non-included angle: C must be the angle physically between sides a and b. Plugging in an angle at a different vertex gives a meaningless side c.
- Angle out of range: C must be strictly between 0° and 180° (or 0 and π radians). At either boundary the "triangle" collapses into a straight line.
- Mixing degrees and radians: set the Angle unit selector to match what you typed — 60 typed as radians is over 3,400° and will not describe a real triangle-solving scenario.
- Confusing Law of Cosines with Law of Sines: the Law of Sines needs at least one angle-side pair that already correspond (opposite each other); use it instead when you know two angles and a side, or two sides and a non-included angle.
Real-world applications
- Surveying and navigation use the Law of Cosines to find a missing distance when two legs of a triangular path and the angle between them are known (triangulation).
- Engineering and construction use it to solve for a diagonal brace or truss length given two known members and the angle at their joint.
- Physics uses the same relation as the vector form for combining two vectors at a known angle to find the resultant magnitude.
- Navigation and aviation use it in dead-reckoning to determine distance after a heading change (angle) over a known leg.