Skip to content

Main content

Weighted Distance Zeroaxis Equivalence Flag Tool

Calculate weighted distance zeroaxis equivalence flag from explicit caller-supplied inputs.

Loading tool…

Description

equivalent is true when every positive-weight coordinate matches exactly; differingIgnoredAxes lists zero-weight indexes whose values differ.

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.

equivalent is true when every positive-weight coordinate matches exactly; differingIgnoredAxes lists zero-weight indexes whose values differ.

When to use this tool

Use Weighted Distance Zeroaxis Equivalence Flag when checking one weighted-axis contribution, support rule or derivative.

How to use the tool and how it works

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

Require equally long first, second and nonnegative weights arrays. equivalent is true when every positive-weight coordinate matches exactly; differingIgnoredAxes lists zero-weight indexes whose values differ.1

Input fieldMeaning and unitsAccepted input
firstFirstRequired. Array of finite number; maximum items 256.
secondSecondRequired. Array of finite number; maximum items 256.
weightsPosition-aligned nonnegative weights under the specified model convention.Required. Array of finite number; maximum items 256.
Output fieldInterpretationReturned shape
equivalentExact agreement on positive-weight axes only; zero-weight differences are ignored.Required. Boolean.
differingIgnoredAxesDiffering Ignored AxesRequired. Array of safe integer; maximum items 256.
json
{
  "input": {
    "first": [
      1,
      2
    ],
    "second": [
      1,
      5
    ],
    "weights": [
      1,
      0
    ]
  },
  "output": {
    "equivalent": true,
    "differingIgnoredAxes": [
      1
    ]
  }
}

Limitations and assumptions

  • Zero weights create equivalence classes, so this is generally a pseudometric convention rather than identity of vectors. No tolerance, missing-value policy or distance magnitude is computed.
  • 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/weighted-distance-zeroaxis-equivalence-flag — tool.io

Similar or alternative tools