Skip to content

Main content

Canberra Zero Pair Convention Tool

Calculate canberra zero pair convention from explicit caller-supplied inputs.

Loading tool…

Description

Return one Canberra-distance contribution with a zero-pair convention.

Weighted coordinate distances depend on whether weights multiply absolute differences or squared differences. Zero weights can make different vectors equivalent, and derivatives at a zero distance or absolute-value corner need explicit treatment.

Return one Canberra-distance contribution with a zero-pair convention.

When to use this tool

Use Canberra Zero Pair Convention when checking one weighted-axis contribution, support rule or derivative.

How to use the tool and how it works

  1. Enter first, second. 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 contribution, bothZero. Inspect bothZero before interpreting the associated values.

Return one Canberra-distance contribution with a zero-pair convention. Denominator is abs(first)+abs(second); use abs(first-second)/denominator when positive, otherwise zero and bothZero = true.1

Input fieldMeaning and unitsAccepted input
firstFirstRequired. Finite number.
secondSecondRequired. Finite number.
Output fieldInterpretationReturned shape
contributionContributionRequired. Finite number.
bothZeroBoth ZeroRequired. Boolean.
json
{
  "input": {
    "first": 0,
    "second": 0
  },
  "output": {
    "contribution": 0,
    "bothZero": true
  }
}

Limitations and assumptions

  • This is one scalar term rather than a summed vector 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 a complete distance implementation with an explicit weighting and missing-coordinate convention for vector comparison and optimization.

References

  1. Calculation and input contract: distance/canberra-zero-pair-convention — tool.io

Similar or alternative tools