The formula is well known and can be written in many ways.
The hypotenuse is a segment of a line through the corners.
The corners you describe are $(0,a),(b,0)$. A formula for a line through these points is $x \mapsto (1- { x \over b}) a $ (which is the same as the formula you have written above).