Catalog/geometry-vector-reflect

Geometry

Reflect vector about normal API

Specular reflection of a vector about a surface normal (r = d − 2(d·n̂)n̂), with incidence angles. Answers 'what is the reflected ray off this surface?', 'what is the angle of incidence?'.

Price$0.01per request
MethodPOST
Route/v1/geometry/vector-reflect
StatusLive
MIME typeapplication/json
Rate limit120/minute
Cache0s public
reflectionvectornormalspecularraytracingincidence3d
API URLhttps://x402.hexl.dev/v1/geometry/vector-reflect
Integration docs
Example request
{
  "vector": [
    1,
    -1,
    0
  ],
  "normal": [
    0,
    1,
    0
  ]
}
Example response
{
  "reflected": [
    1,
    1,
    0
  ],
  "unitNormal": [
    0,
    1,
    0
  ],
  "componentAlongNormal": -1,
  "incidenceAngleFromSurfaceDeg": 45,
  "incidenceAngleFromNormalDeg": 45,
  "interpretation": "Reflected vector preserves magnitude (1.414213562)."
}
Input schema
{
  "type": "object",
  "required": [
    "vector",
    "normal"
  ],
  "properties": {
    "vector": {
      "type": "array",
      "items": {
        "type": "number"
      },
      "examples": [
        [
          1,
          -1,
          0
        ]
      ]
    },
    "normal": {
      "type": "array",
      "items": {
        "type": "number"
      },
      "description": "surface normal (need not be unit)",
      "examples": [
        [
          0,
          1,
          0
        ]
      ]
    }
  }
}
Output schema
{
  "type": "object",
  "additionalProperties": true
}