Catalog/geometry-line-line-intersect

Geometry

Line-line intersection 2D API

Intersection of two infinite 2D lines given by point pairs, flagging parallel and coincident cases. Answers 'where do these two lines cross?', 'are these lines parallel?'.

Price$0.01per request
MethodPOST
Route/v1/geometry/line-line-intersect
StatusLive
MIME typeapplication/json
Rate limit120/minute
Cache0s public
intersectionline2dparallelcoincidentgeometry
API URLhttps://x402.hexl.dev/v1/geometry/line-line-intersect
Integration docs
Example request
{
  "p1": [
    0,
    0
  ],
  "p2": [
    2,
    2
  ],
  "p3": [
    0,
    2
  ],
  "p4": [
    2,
    0
  ]
}
Example response
{
  "intersects": true,
  "parallel": false,
  "point": [
    1,
    1
  ]
}
Input schema
{
  "type": "object",
  "required": [
    "p1",
    "p2",
    "p3",
    "p4"
  ],
  "properties": {
    "p1": {
      "type": "array",
      "items": {
        "type": "number"
      },
      "examples": [
        [
          0,
          0
        ]
      ]
    },
    "p2": {
      "type": "array",
      "items": {
        "type": "number"
      },
      "examples": [
        [
          2,
          2
        ]
      ]
    },
    "p3": {
      "type": "array",
      "items": {
        "type": "number"
      },
      "examples": [
        [
          0,
          2
        ]
      ]
    },
    "p4": {
      "type": "array",
      "items": {
        "type": "number"
      },
      "examples": [
        [
          2,
          0
        ]
      ]
    }
  }
}
Output schema
{
  "type": "object",
  "additionalProperties": true
}