Skip to content

Main content

Pupil Center Coordinate Gap Tool

Calculate pupil center coordinate gap from explicit caller-supplied inputs.

Loading tool…

Description

Return dx=secondX-firstX, dy=secondY-firstY, and distance=hypot(dx,dy).

Optical calculations distinguish lens power in diopters, prism notation, angular axes, geometric distances, and visual-acuity reporting scales. Sign conventions and length units are especially important when a formula combines power with decentration or vertex distance. A supplied model term is separate from a validated visual test or prescription.

Return dx=secondX-firstX, dy=secondY-firstY, and distance=hypot(dx,dy).

When to use this tool

Use Pupil Center Coordinate Gap when you need this explicit optical, chart, frame, axis, or reference conversion with compatible supplied units.

How to use the tool and how it works

  1. Enter firstX, firstY, secondX, secondY. 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 dx, dy, distance. Use the output convention below.

Return dx=secondX-firstX, dy=secondY-firstY, and distance=hypot(dx,dy).1

Input fieldMeaning and unitsAccepted input
firstXFirst XRequired. Finite number.
firstYFirst YRequired. Finite number.
secondXSecond XRequired. Finite number.
secondYSecond YRequired. Finite number.
Output fieldInterpretationReturned shape
dxDxRequired. Finite number.
dyDyRequired. Finite number.
distanceDistanceRequired. Finite number.
json
{
  "input": {
    "firstX": 1,
    "firstY": 2,
    "secondX": 4,
    "secondY": 6
  },
  "output": {
    "dx": 3,
    "dy": 4,
    "distance": 5
  }
}

Limitations and assumptions

  • Coordinates need one planar frame and unit. This compares supplied points without detecting pupil centers, calibrating an image, or estimating measurement or clinical accuracy.
  • 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 the appropriate complete optical or measurement model when a scalar term is insufficient. Verify power, axis, length, notation, and reference conventions before applying the result within a broader assessment.

References

  1. Calculation and input contract: optometry/pupil-center-coordinate-gap — tool.io

Similar or alternative tools