{
  "aliases": [
    "cosine-rule"
  ],
  "backlinks": null,
  "body": "\n## Statement\n\nLet $ABC$ be a [[triangle|0CTNFGYMM2]] in the Euclidean space $\\mathbb{R}^n$. Let $a = d(B, C)$, $b = d(C, A)$ and $c = d(A, B)$ be its side lengths, where $d$ is the [[Euclidean distance|0NPPGHQNXQ]]. Let $\\gamma = \\angle ACB$ be its [[angle|0GJAJC6TNZ]] at $C$.\nThen\n$$c^2 = a^2 + b^2 - 2ab \\cos \\gamma.$$\n\n## Remarks\n\nThe proof in vector form is short. With $u = A - C$ and $v = B - C$: $c^2 = \\|u - v\\|^2 = \\|u\\|^2 + \\|v\\|^2 - 2 u \\cdot v$, and $u \\cdot v = ab \\cos \\gamma$.\nFor $\\gamma = \\pi / 2$ the formula is the [[Pythagorean theorem|0VP3A1290K]].\nThe formula lets you find the third side from two sides and the angle between them. It also gives each angle from the three sides.\nMathlib states the formula for all points, with its convention for the angle at a repeated point.\n\n## History\n\nBook II of Euclid's Elements contains the statement in the language of areas of rectangles. Propositions 12 and 13 of Book II treat the obtuse and the acute case.\n\n## Explanations\n\n### L1 human\n\nThe law of cosines corrects the Pythagorean theorem for triangles without a right angle. If the angle $\\gamma$ is larger than a right angle, $\\cos \\gamma \u003c 0$, and the opposite side is longer than in the right triangle. If $\\gamma$ is smaller, the opposite side is shorter.\n",
  "commit": "f591989ed15704e9d8755a7a5a6426d73de7a3ae",
  "front": {
    "aliases": [
      "cosine-rule"
    ],
    "kind": "statement",
    "msc": [
      "51M04"
    ],
    "name": "Law of cosines",
    "role": "theorem",
    "same_as": {
      "wikidata": "Q164321",
      "wikipedia": "Law of cosines"
    },
    "sources": [
      {
        "locator": "lead section",
        "url": "https://en.wikipedia.org/wiki/Law_of_cosines"
      }
    ],
    "tag": "060ZVZBV3E",
    "uses": [
      "0CTNFGYMM2",
      "0GJAJC6TNZ",
      "0NPPGHQNXQ"
    ]
  },
  "kind": "statement",
  "link": "https://math2.tamnd.com/node/060ZVZBV3E/",
  "links": [
    {
      "field": "uses",
      "target": "0CTNFGYMM2"
    },
    {
      "field": "uses",
      "target": "0GJAJC6TNZ"
    },
    {
      "field": "uses",
      "target": "0NPPGHQNXQ"
    }
  ],
  "markdown": "https://math2.tamnd.com/node/060ZVZBV3E.md",
  "msc": [
    "51M04"
  ],
  "name": "Law of cosines",
  "prov": null,
  "role": "theorem",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/060/060ZVZBV3E.md",
  "status": null,
  "tag": "060ZVZBV3E",
  "uri": "m2://060ZVZBV3E",
  "url": "https://math2.tamnd.com/wiki/law-of-cosines/",
  "writing": {
    "tag": "060ZVZBV3E",
    "kind": "statement",
    "level": "W1",
    "next": [
      {
        "what": "edge about out",
        "note": "the concepts that the statement is about",
        "have": 0,
        "want": 1
      },
      {
        "what": "edge proves in",
        "note": "at least one proof node",
        "have": 0,
        "want": 1
      },
      {
        "what": "edge instance_of or illustrates in",
        "note": "one example that shows the statement at work",
        "have": 0,
        "want": 1
      },
      {
        "what": "explanation L2",
        "have": 0,
        "want": 1
      }
    ]
  }
}
