Description
Project a point onto a ray with origin clamping.
A signed distance depends on a chosen normal or axis orientation. Projection parameters, perpendicular distances and reflected signs are different quantities; a nonunit direction introduces a scale into its parameter.
Project a point onto a ray with origin clamping.
When to use this tool
Use Point To Ray Projection Clamp Gap when checking a supplied projection, orientation or reflection convention.
How to use the tool and how it works
- Enter point, origin, direction. Keep parallel arrays aligned. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read parameter, distance, behindOrigin. Inspect behindOrigin before interpreting the associated values.
Project a point onto a ray with origin clamping. Require aligned nonempty vectors and positive squared direction norm; clamp dot(point-origin,direction)/norm² at zero and compute the resulting point distance; behindOrigin tests the unclamped sign.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| point | Point | Required. Array of finite number; maximum items 256. |
| origin | Origin | Required. Array of finite number; maximum items 256. |
| direction | Direction | Required. Array of finite number; maximum items 256. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| parameter | Nonnegative coefficient multiplying direction; length only when direction has unit norm. | Required. Finite number. |
| distance | Distance | Required. Finite number. |
| behindOrigin | Whether the unclamped projection coefficient is strictly negative. | Required. Boolean. |
{
"input": {
"point": [
3,
4
],
"origin": [
0,
0
],
"direction": [
1,
0
]
},
"output": {
"parameter": 3,
"distance": 4,
"behindOrigin": false
}
} Limitations and assumptions
- The parameter is a distance only for unit direction; floating-point extremes can invalidate results.
- Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.
- Numeric calculations use binary floating point unless exact decimal-integer arithmetic is explicitly stated. No hidden measurement tolerance or decimal rounding is added; nonfinite or out-of-contract results are rejected. Numeric signed-zero results are exported as zero.
Alternative or Complementary methods
Use complete geometric objects and consistent units to compute actual distances, projections or multi-axis reflections.
References
Similar or alternative tools
- Point To Plane Normal Scale Invariance
Compare plane-distance expressions before and after coefficient scaling.
- Point To Sphere Signed Radial Gap
Return a point's signed radial gap from a sphere.