{
  "aliases": null,
  "backlinks": null,
  "body": "\n## Summary\n\nConvex hull algorithms take a finite set of $n$ points in $\\R^d$ and compute its [[convex hull|0FQSDC2EQ2]].\nThe output is usually the list of its vertices or of its facets.\nIn the plane, Graham scan and other methods run in $O(n \\log n)$ time.\nGift wrapping runs in $O(n h)$ time, where $h$ is the number of hull vertices.\nChan's algorithm combines both ideas and runs in $O(n \\log h)$ time.\nSince sorting reduces to the planar convex hull problem, $\\Omega(n \\log n)$ operations are needed in the worst case in the algebraic decision tree model.\nThese algorithms are a basic building block of [[computational geometry|KAT7K2NE9Z]].\n\n## Explanations\n\n### L1 human\n\nHammer nails into a board at some points and stretch a rubber band around all of them; the band takes the shape of the convex hull.\nA convex hull algorithm finds which nails the band touches.\nGift wrapping starts at the leftmost nail and repeatedly turns to the nail that keeps all others on one side, like wrapping a present.\nFor the points $(0,0)$, $(2,0)$, $(1,1)$, $(1,3)$, the hull is the triangle with corners $(0,0)$, $(2,0)$, $(1,3)$, and $(1,1)$ lies inside it.\n",
  "commit": "ff8a40749dc16545e3d2fc637f6b0196e81d0bfa",
  "front": {
    "kind": "concept",
    "msc": [
      "68U05",
      "52B55",
      "68W40"
    ],
    "name": "Convex hull algorithms",
    "same_as": {
      "wikidata": "Q5166520",
      "wikipedia": "Convex hull algorithms"
    },
    "sources": [
      {
        "url": "https://en.wikipedia.org/wiki/Convex_hull_algorithms"
      }
    ],
    "tag": "R8071FWJRK"
  },
  "kind": "concept",
  "link": "https://tamnd.github.io/math2/node/R8071FWJRK/",
  "links": null,
  "markdown": "https://tamnd.github.io/math2/node/R8071FWJRK.md",
  "msc": [
    "68U05",
    "52B55",
    "68W40"
  ],
  "name": "Convex hull algorithms",
  "prov": null,
  "role": "",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/R80/R8071FWJRK.md",
  "status": null,
  "tag": "R8071FWJRK",
  "uri": "m2://R8071FWJRK",
  "url": "https://tamnd.github.io/math2/wiki/convex-hull-algorithms/",
  "writing": {
    "tag": "R8071FWJRK",
    "kind": "concept",
    "level": "W0",
    "next": [
      {
        "what": "an inventory row",
        "note": "the row of the inventory that the node accounts for",
        "have": 0,
        "want": 1
      },
      {
        "what": "a source with a locator",
        "have": 0,
        "want": 1
      }
    ]
  }
}
