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
- Enter signedWidth, signedHeight. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- 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 field | Meaning and units | Accepted input |
|---|---|---|
| signedWidth | Signed Width | Required. Finite number. |
| signedHeight | Signed Height | Required. Finite number. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| unitX | Unit X | Required. Finite number. |
| unitY | Unit Y | Required. Finite number. |
| diagonalLength | Diagonal Length | Required. Finite number. |
{
"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
Similar or alternative tools
- Parallelogram Signed Height From Cross Product
Calculate a parallelogram's signed left-positive height from two vectors.
- Cuboid Space Diagonal Direction Cosine Tool
Calculate cuboid space diagonal direction cosine from explicit caller-supplied inputs.