Created
April 25, 2013 13:49
-
-
Save huyderman/5459828 to your computer and use it in GitHub Desktop.
Math
This file contains 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
# Calculates the area of a triangle given the length of it's sides | |
def heron(a, b, c) | |
s = (a+b+c)/2 | |
Math.sqrt(s*(s-a)*(s-b)*(s-c)) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment