Skip to content

Main content

Signed Ray Distance Behind Origin Flag Tool

Signed orthogonal projection parameter along a supplied nonzero ray direction.

Loading tool…

Description

Project a point onto a ray’s supporting line and flag a parameter behind the origin.

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’s supporting line and flag a parameter behind the origin.

When to use this tool

Use Signed Ray Distance Behind Origin Flag when checking a supplied projection, orientation or reflection convention.

How to use the tool and how it works

  1. Enter point, origin, direction. Keep parallel arrays aligned. Use the units and conventions below.
  2. Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
  3. Read parameter, behindOrigin. Inspect behindOrigin before interpreting the associated values.

Require equally long nonempty point, origin and direction arrays and a nonzero direction vector. parameter = dot(point-origin,direction)/dot(direction,direction); behindOrigin tests the numerator < 0.1

Input fieldMeaning and unitsAccepted input
pointPointRequired. Array of finite number; maximum items 256.
originOriginRequired. Array of finite number; maximum items 256.
directionDirectionRequired. Array of finite number; maximum items 256.
Output fieldInterpretationReturned shape
parameterSupporting-line projection parameter; physical distance only for unit direction.Required. Finite number.
behindOriginBehind OriginRequired. Boolean.
json
{
  "input": {
    "point": [
      2,
      0
    ],
    "origin": [
      0,
      0
    ],
    "direction": [
      1,
      0
    ]
  },
  "output": {
    "parameter": 2,
    "behindOrigin": false
  }
}

Limitations and assumptions

  • The parameter is not a physical distance unless direction is unit length. This projects onto the supporting line without clamping to the ray or returning perpendicular distance.
  • 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

  1. Calculation and input contract: distance/signed-ray-distance-behind-origin-flag — tool.io

Similar or alternative tools