Catalog/geometry-vector-ops

Geometry

2D/3D vector toolkit API

Full 2D/3D vector operations on a pair: add, subtract, dot, cross, magnitudes, angle between, scalar/vector projection and unit vectors in one call. Answers 'what is the angle between these vectors?', 'what is the projection of a onto b?'.

Price$0.01per request
MethodPOST
Route/v1/geometry/vector-ops
StatusLive
MIME typeapplication/json
Rate limit120/minute
Cache0s public
vectordotcrossprojectionanglenormalize3dlinear-algebra
API URLhttps://x402.hexl.dev/v1/geometry/vector-ops
Integration docs
Example request
{
  "a": [
    1,
    2,
    2
  ],
  "b": [
    2,
    0,
    0
  ]
}
Example response
{
  "dimension": 3,
  "sum": [
    3,
    2,
    2
  ],
  "difference": [
    -1,
    2,
    2
  ],
  "dotProduct": 2,
  "crossProduct": [
    0,
    4,
    -4
  ],
  "magnitudeA": 3,
  "magnitudeB": 2,
  "angleRad": 1.230959417,
  "angleDeg": 70.528779366,
  "scalarProjectionAontoB": 1,
  "vectorProjectionAontoB": [
    1,
    0,
    0
  ],
  "unitA": [
    0.333333333,
    0.666666667,
    0.666666667
  ],
  "unitB": [
    1,
    0,
    0
  ],
  "interpretation": "angle between vectors is 70.529°."
}
Input schema
{
  "type": "object",
  "required": [
    "a",
    "b"
  ],
  "properties": {
    "a": {
      "type": "array",
      "items": {
        "type": "number"
      },
      "description": "2D or 3D vector",
      "examples": [
        [
          1,
          2,
          2
        ]
      ]
    },
    "b": {
      "type": "array",
      "items": {
        "type": "number"
      },
      "description": "2D or 3D vector (same dimension as a)",
      "examples": [
        [
          2,
          0,
          0
        ]
      ]
    }
  }
}
Output schema
{
  "type": "object",
  "additionalProperties": true
}