Created
June 20, 2013 17:31
-
-
Save otanodesignco/5824819 to your computer and use it in GitHub Desktop.
Calculate the Hypotenuse of a Triangle give the A & B sides.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function hypotenuse($A, $B) | |
{ | |
if(is_numeric($A) && is_numeric($B)) | |
{ | |
return sqrt(($A * $A) + ($B * $B)); | |
} | |
else | |
{ | |
return 0; | |
} | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment