{
  "aliases": null,
  "backlinks": null,
  "body": "\n## Definition\n\nLet $n$ be a positive integer, and let $p = (p_1, \\dots, p_n)$ and $q = (q_1, \\dots, q_n)$ be points of $\\mathbb{R}^n$.\nThe Euclidean distance between $p$ and $q$ is the real number\n$$d(p, q) = \\|p - q\\| = \\sqrt{(p_1 - q_1)^2 + (p_2 - q_2)^2 + \\dots + (p_n - q_n)^2},$$\nwhere $\\|p - q\\|$ is the [[length|0XKBKGTCPC]] of the vector $p - q$.\n\n## Remarks\n\nThe function $d$ is a metric on $\\mathbb{R}^n$. For all points $p$, $q$ and $r$: $d(p, q) \\geq 0$, $d(p, q) = 0$ if and only if $p = q$, $d(p, q) = d(q, p)$, and $d(p, r) \\leq d(p, q) + d(q, r)$.\nFor $n = 1$ the formula is $d(p, q) = |p - q|$.\nSome applications use the squared distance $d(p, q)^2$, because it has no square root. The squared distance is not a metric, because it does not satisfy the triangle inequality.\n\n## Explanations\n\n### L1 human\n\nTo find the distance between two points in the plane, draw the right triangle with horizontal and vertical legs between them. The legs have lengths $|p_1 - q_1|$ and $|p_2 - q_2|$. The distance is the hypotenuse, so the Pythagorean theorem gives the formula. For $(1, 1)$ and $(4, 5)$ the distance is $\\sqrt{9 + 16} = 5$.\n",
  "commit": "545acf83a9b75c8ddc375ef8b23d2ae101a4d7e4",
  "front": {
    "defines": "0NPPGHQNXQ",
    "kind": "definition",
    "msc": [
      "51N20"
    ],
    "name": "Euclidean distance",
    "sources": [
      {
        "locator": "Higher dimensions",
        "url": "https://en.wikipedia.org/wiki/Euclidean_distance"
      }
    ],
    "tag": "0C95TG69SG",
    "uses": [
      "0XPR1E85W0",
      "0XKBKGTCPC"
    ]
  },
  "kind": "definition",
  "link": "https://math2.tamnd.com/node/0C95TG69SG/",
  "links": [
    {
      "field": "defines",
      "target": "0NPPGHQNXQ"
    },
    {
      "field": "uses",
      "target": "0XPR1E85W0"
    },
    {
      "field": "uses",
      "target": "0XKBKGTCPC"
    }
  ],
  "markdown": "https://math2.tamnd.com/node/0C95TG69SG.md",
  "msc": [
    "51N20"
  ],
  "name": "Euclidean distance",
  "prov": null,
  "role": "",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/0C9/0C95TG69SG.md",
  "status": null,
  "tag": "0C95TG69SG",
  "uri": "m2://0C95TG69SG",
  "url": "https://math2.tamnd.com/wiki/euclidean-distance-definition/",
  "writing": {
    "tag": "0C95TG69SG",
    "kind": "definition",
    "level": "W1",
    "next": [
      {
        "what": "edge instance_of in",
        "note": "one example",
        "have": 0,
        "want": 1
      },
      {
        "what": "edge not_instance_of in",
        "note": "one non-example that fails one clause",
        "have": 0,
        "want": 1
      }
    ]
  }
}
