Created
July 24, 2015 12:27
-
-
Save ejmurray/f0b6c2592f642dd46147 to your computer and use it in GitHub Desktop.
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
#!/usr/bin/env python | |
__author__ = 'Ernest' | |
import math | |
def distance(x1, y1, x2, y2): | |
dx = x2 - x1 | |
dy = y2 - y1 | |
dsquared = dx**2 + dy**2 | |
result = dsquared**0.5 | |
return result | |
def area(radius): | |
temp = 3.14159 * radius**2 | |
return temp | |
def area2(xc, yc, xp, yp): | |
radius = distance(xc, yc, xp, yp) | |
result = area(radius) | |
return result | |
a = area2(1, 2, 4, 6) | |
print a |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment