Al Kashi Calculator
Use this premium Al Kashi calculator to solve non-right triangles with the Law of Cosines. Compute a missing side from two sides and the included angle, or find a missing angle from all three sides with instant validation, clear steps, and a live chart.
Results
Enter known values, choose a mode, and click Calculate to apply Al Kashi’s theorem.
What is an Al Kashi calculator?
An Al Kashi calculator is a geometry tool that applies the Law of Cosines, a foundational relationship for solving oblique triangles. The theorem is often credited in modern classrooms as the Law of Cosines, but it is also associated with the Persian mathematician Jamshid al-Kashi, whose work helped refine computational mathematics and trigonometric methods. In practical terms, this calculator lets you determine an unknown side or angle when a triangle is not necessarily a right triangle.
If you already know two sides and the included angle, Al Kashi’s relation gives the third side. If you know all three sides, the same relation can be rearranged to find a missing angle. That flexibility makes the method indispensable in surveying, navigation, structural design, robotics, computer graphics, astronomy, and higher-level mathematics.
The core formula is simple but powerful. For a triangle with sides a, b, and c, and angle C opposite side c, the theorem states:
c2 = a2 + b2 – 2ab cos(C)
When you need the angle instead, the equation becomes:
cos(C) = (a2 + b2 – c2) / (2ab)
The calculator above automates those transformations and validates your input so you can focus on interpretation rather than manual arithmetic.
How to use this Al Kashi calculator
- Select the calculation mode. Choose Solve for side c if you know two sides and the included angle. Choose Solve for angle C if you know all three sides.
- Choose your preferred angle unit. Degrees are ideal for most classroom and real-world applications, while radians are common in advanced mathematics and physics.
- Enter the known values. Side lengths must be positive numbers. Angles must be valid values for a triangle.
- Choose the number of decimal places if you want cleaner rounding for reports, homework, or engineering notes.
- Click Calculate. The tool will display the result, the formula used, a triangle classification, and a chart comparing the side lengths.
The reset button clears the current values so you can test a new triangle immediately.
When should you use the Law of Cosines?
The Law of Cosines is the correct choice whenever a triangle is not right angled and the Pythagorean theorem alone is not enough. You will typically use it in two common situations:
- SAS case: You know two sides and the included angle, and you want the third side.
- SSS case: You know all three sides, and you want one of the angles.
By contrast, if the triangle is a perfect right triangle, the Law of Cosines reduces to the Pythagorean theorem because cos(90°) = 0. That means Al Kashi’s theorem is more general. It contains the right triangle rule as a special case and extends it to acute and obtuse triangles.
Example 1: Find a missing side
Suppose side a = 8, side b = 11, and included angle C = 40°. Apply the formula:
c2 = 82 + 112 – 2(8)(11)cos(40°)
That gives a positive value under the square root, producing a side length of about 7.07. This is the kind of result our calculator returns instantly.
Example 2: Find a missing angle
Suppose a = 7, b = 9, and c = 12. Rearranging the theorem gives:
cos(C) = (72 + 92 – 122) / (2(7)(9))
After computing the cosine and taking the inverse cosine, you obtain the angle C. If the value is greater than 90°, the triangle is obtuse at C. This matters in engineering, because obtuse triangles change load paths, diagonal spans, and projection lengths.
Comparison table: common included angles and resulting third side
The table below shows how the third side changes when sides a and b are both 10 units and only the included angle changes. These are real computed values from the Law of Cosines and illustrate how sensitive side c is to angle growth.
| Angle C | cos(C) | Computed c2 | Computed side c | Triangle interpretation |
|---|---|---|---|---|
| 30° | 0.8660 | 26.795 | 5.176 | Narrow acute triangle with short opposite side |
| 60° | 0.5000 | 100.000 | 10.000 | Equilateral case when all sides are equal |
| 90° | 0.0000 | 200.000 | 14.142 | Matches the Pythagorean theorem |
| 120° | -0.5000 | 300.000 | 17.321 | Obtuse triangle with a much longer opposite side |
| 150° | -0.8660 | 373.205 | 19.318 | Very wide triangle approaching a straight line |
Why the formula works
The intuition behind the Law of Cosines comes from projecting one side onto another. In coordinate geometry, you can place one side of the triangle on the horizontal axis and decompose the other side into horizontal and vertical components using cosine and sine. When you then compute the distance between the endpoints, the cosine term naturally appears. This geometric derivation explains why the theorem bridges triangle geometry and trigonometry so effectively.
Another way to think about it is as a distance formula for two segments meeting at an angle. If the angle opens wider, the opposite side must increase. If the angle gets smaller, the opposite side decreases. The cosine function captures that exact directional effect.
Comparison table: Pythagorean theorem vs Al Kashi theorem
This second table shows how the Law of Cosines generalizes the right triangle rule. For sides a = 12 and b = 16, the third side changes significantly as the included angle moves away from 90°.
| Given a | Given b | Included angle C | Side c from Al Kashi | Difference from right-triangle value 20 |
|---|---|---|---|---|
| 12 | 16 | 60° | 14.422 | -5.578 |
| 12 | 16 | 90° | 20.000 | 0.000 |
| 12 | 16 | 110° | 23.049 | +3.049 |
| 12 | 16 | 135° | 25.939 | +5.939 |
Common mistakes to avoid
- Mixing degrees and radians: A calculator in radian mode will produce the wrong result if you type 60 expecting degrees.
- Using the wrong angle: The angle in the SAS formula must be the included angle between the two known sides.
- Ignoring triangle validity: For the SSS case, the triangle inequality must hold. If one side is greater than or equal to the sum of the other two, no triangle exists.
- Rounding too early: Rounding intermediate cosine values too soon can introduce visible errors, especially in sensitive engineering work.
- Forgetting side-angle correspondence: Angle C is opposite side c. If your labels are inconsistent, the answer will be mathematically correct for a different triangle than the one you intended.
Applications of an Al Kashi calculator
The Law of Cosines appears in more places than many people expect. In land surveying, it helps estimate boundary distances when two measured sides and the included bearing angle are known. In civil and structural engineering, it is used to resolve diagonal members, spans, and force directions in trusses or frames. In robotics and computer graphics, triangle calculations support motion, orientation, and mesh processing. In astronomy and navigation, trigonometric relationships help model distances and angular separation.
Students also benefit from Al Kashi tools because they make abstract formulas tangible. By changing one angle and watching the opposite side update instantly, learners can develop stronger intuition about how triangle geometry behaves.
How to check your result manually
- Write the correct version of the formula for your known values.
- Square the sides carefully.
- Evaluate the cosine using the right angle unit.
- Multiply the cross term 2ab cos(C).
- Subtract or rearrange as required.
- For side calculations, take the positive square root.
- For angle calculations, use inverse cosine and verify the value is between 0 and 180 degrees, or between 0 and π radians.
If your result seems strange, check whether your angle was included, whether your sides are positive, and whether the labels match the intended triangle.
Authoritative educational references
If you want to study the theorem in more depth, these academic resources are excellent starting points:
- Lamar University: Law of Cosines overview and worked examples
- Richland Community College: Law of Cosines explanation
- The University of Texas at Austin: Trigonometric identities and triangle relationships
Final takeaway
An Al Kashi calculator is one of the most practical tools for solving non-right triangles. It extends far beyond classroom exercises because it provides an exact relationship between side lengths and included angle. If you know two sides and the angle between them, you can compute the third side. If you know the three sides, you can recover the angle. That is why this theorem sits at the heart of applied trigonometry.
Use the calculator above when you need fast, reliable triangle solutions with built-in interpretation. Whether you are a student checking homework, a teacher preparing examples, or a professional working with angled dimensions, the Law of Cosines remains one of the most useful formulas in geometry.