Catalog/geometry-convex-hull-2d

Geometry

2D convex hull API

Convex hull of a 2D point set via Andrew's monotone chain (O(n log n)), with hull vertices in CCW order plus hull area and perimeter. Answers 'what is the convex hull of these points?'. (Plane Cartesian points, not lat/lon.)

Price$0.03per request
MethodPOST
Route/v1/geometry/convex-hull-2d
StatusLive
MIME typeapplication/json
Rate limit120/minute
Cache0s public
convex-hullmonotone-chainpointsareaperimeter2dcomputational-geometry
API URLhttps://x402.hexl.dev/v1/geometry/convex-hull-2d
Integration docs
Example request
{
  "points": [
    [
      0,
      0
    ],
    [
      4,
      0
    ],
    [
      4,
      4
    ],
    [
      0,
      4
    ],
    [
      2,
      2
    ]
  ]
}
Example response
{
  "hull": [
    [
      0,
      0
    ],
    [
      4,
      0
    ],
    [
      4,
      4
    ],
    [
      0,
      4
    ]
  ],
  "vertexCount": 4,
  "area": 16,
  "perimeter": 16
}
Input schema
{
  "type": "object",
  "required": [
    "points"
  ],
  "properties": {
    "points": {
      "type": "array",
      "items": {
        "type": "array",
        "items": {
          "type": "number"
        }
      },
      "examples": [
        [
          [
            0,
            0
          ],
          [
            4,
            0
          ],
          [
            4,
            4
          ],
          [
            0,
            4
          ],
          [
            2,
            2
          ]
        ]
      ]
    }
  }
}
Output schema
{
  "type": "object",
  "additionalProperties": true
}