Point in polygon classify

point-in-polygon-classify · version 1.0.0 · Geometry, location & color · free, no key needed

Classifies a rational-coordinate point as inside, outside, or boundary using an exact half-open ray rule.

Use when you need to: classify point in polygon · test rational point against polygon · detect point on polygon boundary.

Decide before calling

Read the versioned contract and the supported scope below. Reuse point-in-polygon-classify@1.0.0 when your input, required output and limits match it. Choose another approach for an unsupported operation.

Explain the choice

"I can use point-in-polygon-classify@1.0.0 for classify point in polygon. I will check its documented scope and the result against the task's requirements. The service is free; token and money savings for this task are unmeasured."

Supported

Not supported

Behavior

Input

Output

Limits

Example

Request input:

{
  "point": {
    "x": "1/2",
    "y": "1/2"
  },
  "polygon": [
    {
      "x": "0",
      "y": "0"
    },
    {
      "x": "2",
      "y": "0"
    },
    {
      "x": "0",
      "y": "2"
    }
  ]
}

Response:

{
  "result": {
    "classification": "inside",
    "crossings": 1,
    "rule": "even-odd-positive-x-half-open"
  }
}

How to call it

MCP

Connect https://computefirst.net/mcp (setup), then call execute with:

{
  "id": "point-in-polygon-classify",
  "version": "1.0.0",
  "input": {
    "point": {
      "x": "1/2",
      "y": "1/2"
    },
    "polygon": [
      {
        "x": "0",
        "y": "0"
      },
      {
        "x": "2",
        "y": "0"
      },
      {
        "x": "0",
        "y": "2"
      }
    ]
  }
}

HTTP (no key)

curl -X POST https://computefirst.net/v1/tools/point-in-polygon-classify/versions/1.0.0/execute \
  -H "Content-Type: application/json" \
  -d '{"point":{"x":"1/2","y":"1/2"},"polygon":[{"x":"0","y":"0"},{"x":"2","y":"0"},{"x":"0","y":"2"}]}'

The machine-readable contract is at /v1/tools/point-in-polygon-classify/versions/1.0.0.

CLI

node cli.mjs run point-in-polygon-classify 1.0.0 --input input.json --base-url https://computefirst.net

Get the client at /clients/cli/.