Skip to content

Main content

Matrix Diagonal Unit Offset

Return the column-minus-row diagonal offset and zero-based coordinates under an explicit matrix index convention.

Loading tool…

Description

Calculate a diagonal offset and zero-based row/column indices.

Matrix indices depend on whether counting begins at zero or one and on the direction of row/column offsets. Comparing a transposed entry pair is one local symmetry check. Supplied index arithmetic does not establish matrix dimensions, valid element membership or a global algebraic property.

Calculate a diagonal offset and zero-based row/column indices.

When to use this tool

Use Matrix Diagonal Unit Offset when you already have row, column, oneBased and need to calculate a diagonal offset and zero-based row/column indices.

How to use the tool and how it works

  1. Enter row, column, oneBased. 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 diagonalOffset, rowZeroBased, columnZeroBased. Use the output convention below.

Require safe whole indices consistent with the oneBased flag; return column-row and subtract the selected origin from both indices.1

Input fieldMeaning and unitsAccepted input
rowRowRequired. Safe integer.
columnColumnRequired. Safe integer.
oneBasedOne BasedRequired. Boolean.
Output fieldInterpretationReturned shape
diagonalOffsetcolumn-row; positive is above the main diagonal, independently of the selected index origin.Required. Safe integer.
rowZeroBasedRow Zero BasedRequired. Safe integer.
columnZeroBasedColumn Zero BasedRequired. Safe integer.
json
{
  "input": {
    "row": 2,
    "column": 4,
    "oneBased": true
  },
  "output": {
    "diagonalOffset": 2,
    "rowZeroBased": 1,
    "columnZeroBased": 3
  }
}

Limitations and assumptions

  • Positive offset is above the main diagonal under row/column indexing; no actual matrix dimensions or entries are checked.
  • 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 actual matrix and its declared index convention when checking entries or a global property. Apply complete symmetry or structural checks with an explicit numerical tolerance when one pairwise residual is insufficient.

References

  1. Calculation and input contract: matrix/matrix-diagonal-unit-offset — tool.io

Similar or alternative tools