Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from math import *
- def magnitude(x1, y1, x2, y2):
- return sqrt((x2-x1)2 + (y2-y1)2)
- def area3(x1, y1, x2, y2, x3, y3):
- magnitude(x1,y1,x2,y2)
- return a
- magnitude(x2,y2,x3,y3)
- return b
- magnitude(x3,y3,x1,y1)
- return c
- herons_formula(a,b,c)
- return herons_formula(a,b,c)
- # Don't need to modify the following function
- def herons_formula(a, b, c):
- s = (a + b + c) / 2
- return sqrt(s * (s - a) * (s - b) * (s - c))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement