Advertisement
Guest User

Untitled

a guest
Jan 27th, 2020
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. from math import *
  2.  
  3. def magnitude(x1, y1, x2, y2):
  4. return sqrt((x2-x1)**2 + (y2-y1)**2)
  5.  
  6. def area3(x1, y1, x2, y2, x3, y3):
  7. magnitude(x1,y1,x2,y2)
  8. return a
  9. magnitude(x2,y2,x3,y3)
  10. return b
  11. magnitude(x3,y3,x1,y1)
  12. return c
  13. herons_formula(a,b,c)
  14. return herons_formula(a,b,c)
  15.  
  16.  
  17.  
  18. # Don't need to modify the following function
  19. def herons_formula(a, b, c):
  20. s = (a + b + c) / 2
  21. return sqrt(s * (s - a) * (s - b) * (s - c))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement