suve

awful: function: hypotenuse

Declaration

float :hypotenuse ( float $A , float $B )

Summary

Returns the length of the hypotenuse in a right triangle, where A and B are length of its catheti. This is done using the Pythagorean Theorem.

Example

# :hypotenuse example
:writeln :hypotenuse  i3  i4   # Should be 5
:writeln :hypotenuse i10 i20   # Should be 22.360...
:writeln :hypotenuse (:sqrt i2 | :sqrt i2)   # Should be 2.0

wikipage modified on 2014/0601/2317