Skip to content

Main content

Rectangle Diagonal Unit Direction

Normalize an explicit nonzero signed rectangle diagonal into a Euclidean unit direction.

Loading tool…

Description

Calculate the unit direction along a nonzero rectangle diagonal.

Planar orientation and geometric projections depend on the direction of axes and vectors as well as length units. Signed area and height retain side information, while chord sagitta and cone slant angles use specific ideal shapes. Finite-precision formulas and degenerate boundary cases require explicit interpretation.

Calculate the unit direction along a nonzero rectangle diagonal.

When to use this tool

Use Rectangle Diagonal Unit Direction when checking the stated oriented vector, ideal cone or circle convention.

How to use the tool and how it works

  1. Enter signedWidth, signedHeight. 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 unitX, unitY, diagonalLength. Use the output convention below.

Require at least one signed width/height nonzero. Return hypot(width,height) and each component divided by that diagonal length.1

Input fieldMeaning and unitsAccepted input
signedWidthSigned WidthRequired. Finite number.
signedHeightSigned HeightRequired. Finite number.
Output fieldInterpretationReturned shape
unitXUnit XRequired. Finite number.
unitYUnit YRequired. Finite number.
diagonalLengthDiagonal LengthRequired. Finite number.
json
{
  "input": {
    "signedWidth": 3,
    "signedHeight": 4
  },
  "output": {
    "unitX": 0.6,
    "unitY": 0.8,
    "diagonalLength": 5
  }
}

Limitations and assumptions

  • The signed dimensions are vector components; no rectangle layout, physical unit or coordinate-frame orientation is inferred.
  • 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 geometry and appropriate robust predicates or uncertainty analysis for near-degenerate inputs and physical design conclusions.

References

  1. Calculation and input contract: geometry/rectangle-diagonal-unit-direction — tool.io

Similar or alternative tools