Skip to content

Instantly share code, notes, and snippets.

@ejmurray
Created July 24, 2015 12:27
Show Gist options
  • Save ejmurray/f0b6c2592f642dd46147 to your computer and use it in GitHub Desktop.
Save ejmurray/f0b6c2592f642dd46147 to your computer and use it in GitHub Desktop.
#!/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