Skip to content

Instantly share code, notes, and snippets.

@ejmurray
Created February 21, 2015 15:19
Show Gist options
  • Save ejmurray/801dd3ca7af8c980225a to your computer and use it in GitHub Desktop.
Save ejmurray/801dd3ca7af8c980225a to your computer and use it in GitHub Desktop.
#!/usr/bin/python
# encoding: utf-8
"""
Description calculate the area of a circle
"""
import math
def distance (x1, y1, x2, y2):
dx = x2 - x1
dy = y2 - y1
dsquared = dx**2 + dy**2
result = math.sqrt(dsquared)
return result
def circle_area(x1, y1, x2, y2):
radius = distance(x1, y1, x2, y2):
result = area(radius)
return result
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment