Elysia Tools

Navigation

Math

Law of Cosines Visualization

Drag the vertices of a triangle to compare the included angle and its opposite side. Follow a signed projection to derive the law of cosines.

Open static visualization

Tool usage guide

Learn when to use this tool, what it supports, and how real users apply it.

Overview

Load the right triangle and compare c² with a² + b². Then load the obtuse triangle and see where the altitude from B meets the extended base.

Match the angle to the opposite side

The sides BC and CA have lengths a and b and meet at C. The opposite side AB has length c. The relation is c² = a² + b² − 2ab cos(C). With three known sides, rearrange the equation to find cos(C).

Keep the sign of the projection

Measure x from C in the direction of A. The foot D lies before C when C is obtuse, giving x < 0. If D passes beyond A, the distance to A is still |b − x|. Squaring the leg lengths makes the same proof work in both positions.

How it works

  1. 1In Explore, drag a vertex or use the arrow keys to move the focused vertex. Watch the angle C and the value of c².
  2. 2Load the right or obtuse preset from Examples and open Proof.
  3. 3Start with the projection x = a cos(C) and follow the algebra through the five steps.
  4. 4In Practice, choose a side or angle problem. Angles are entered in degrees, and two decimal places are enough to check your answer.

Edge cases & common failures

  • Collinear or coincident vertices

    Angles and projections are left blank until the three vertices enclose a triangle.

  • Sides close to the triangle-inequality limit

    In a very thin triangle, subtracting nearly equal numbers can lose precision. The three-side calculation uses a half-angle identity to preserve accuracy near 0° or 180°.

Examples

1. Right triangle

How to use

Load the right triangle and compare the two sides of the formula.

Outcome

C = 90°, c = 5 and x = 0.

2. Obtuse triangle

How to use

Load the obtuse triangle, then look at C and the foot D in Proof.

Outcome

C = 120°, c = 7 and x = −1.50.

3. Side-side-side (SSS)

How to use

Load the side-side-side example and compare the reading with arccos((a² + b² − c²)/(2ab)).

Outcome

Sides 5, 6 and 7 give C ≈ 78.46°.

FAQ

What are SAS and SSS?

SAS gives two sides and the angle between them, which determine the third side. SSS gives three sides, from which you can calculate any interior angle.

At a Glance

Interactive Preview

Law of Cosines Visualization
Static preview of this visualization. Use the interactive panel above to explore it.

Verified Results

Typical Experiments and Results

Every parameter set and result below is a fixed output of this page's built-in model (each asserted before delivery) and reproduces directly: set the Parameters column in the interactive panel.

ScenarioParametersResult
Equilateral trianglea = b = 5, C = 60°c = 5
Right trianglea = 3, b = 4, C = 90°c = 5, x = 0
Obtuse trianglea = 3, b = 5, C = 120°c = 7, x = −1.50
Side-angle-side (SAS)a = 5, b = 8, C = 60°c = 7
Side-side-side (SSS)a = 5, b = 6, c = 7C ≈ 78.46°

Sources

References

Papers and datasets underlying this visualization - every formula, algorithm, and data anchor on the page traces back to the sources below.

  1. [1]

    Jay Abramson (2021). 8.2 Non-right Triangles: Law of Cosines. Precalculus 2e, OpenStax.

    View source→ c² = a² + b² − 2ab cos(C); SAS and SSS
  2. [2]

    Euclid, edited and translated by Richard Fitzpatrick (2008). Euclid's Elements of Geometry. Revised and corrected edition, Book 2.

    View source→ II.12–13, acute and obtuse angle constructions
  3. [3]

    MIT OpenCourseWare (2010). 18.02SC Notes: Dot Product. 18.02SC Multivariable Calculus, Fall 2010.

    View source→ CA · CB = ab cos(C)
  4. [4]

    MIT OpenCourseWare (2010). 18.02SC Notes: Components and Projection. 18.02SC Multivariable Calculus, Fall 2010.

    View source→ x = CB · (CA / b) = a cos(C)
  5. [5]

    W. Kahan (2014). Miscalculating Area and Angles of a Needle-like Triangle. Lecture Notes for Introductory Numerical Analysis Classes, UC Berkeley.

    View source→ §3, half-angle formula for C from a, b, c

Related

Related tools and workflows

Format Conversion

AsciiMath LaTeX MathML Equation Converter

Convert equations between AsciiMath, LaTeX and MathML: auto-detect the input format, produce canonical LaTeX, presentation MathML with an embedded TeX annotation, a best-effort AsciiMath back-translation, a screen-reader aria-label snippet (role=math), and a KaTeX HTML preview.

Development

GitHub Profile README Studio

Generate a complete GitHub profile README — banner, stats tiles, contribution heatmap, 3D contribution skyline and project cards — baked once into static, themeable SVG assets. No badge services that can go down; commit the SVGs next to your README and the profile never breaks.

Math & Numbers

Heat Convection Calculator (Newton's Law, q=hΔT)

Compute convective heat transfer (Newton's law of cooling): heat flux q = h·ΔT (W/m²), heat flow rate Q = h·A·ΔT (W), and convective thermal resistance R_conv = 1/(h·A) (K/W). h is the convective heat-transfer coefficient (W/(m²·K)); ΔT is the temperature difference between the surface and the fluid (K; a °C difference equals a K difference, a °F difference is converted by ×5/9); A the heat-transfer area. ΔT may be negative (indicating reverse heat flow), but h and A must be positive. Area in m²/cm².

Math & Numbers

Gas Law Calculator

Solve pressure, volume, temperature, or moles with the Ideal Gas Law (PV=nRT) or Combined Gas Law; also gas density and molar mass.

Next

More visualizations nearby

Cookie settings

Essential cookies keep the site running. Analytics and personalized ads are optional.

Cookie policy