Skip to main content

corner_to_corner

Function corner_to_corner 

Source
pub fn corner_to_corner(a_mils: f64, b_mils: f64) -> Result<f64, CalcError>
Expand description

Calculate the corner-to-corner (diagonal) distance between two points.

§Arguments

  • a_mils — horizontal span in mils (must be ≥ 0)
  • b_mils — vertical span in mils (must be ≥ 0)

Returns the Euclidean distance √(a² + b²) in mils.

§Errors

Returns CalcError::NegativeDimension if either dimension is negative.