Advertisement
Guest User

Untitled

a guest
Mar 22nd, 2018
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. Double ab = Math.abs(
  2. Math.sqrt(
  3. Math.pow((B.getX()-A.getX()), 2) +
  4. Math.pow((B.getY()-A.getY()), 2)
  5. )
  6. );
  7. Double bc = Math.abs(
  8. Math.sqrt(
  9. Math.pow((C.getX()-B.getX()), 2) +
  10. Math.pow((C.getY()-B.getY()), 2)
  11. )
  12. );
  13. Double ca = Math.abs(
  14. Math.sqrt(
  15. Math.pow((A.getX()-C.getX()), 2) +
  16. Math.pow((A.getY()-C.getY()), 2)
  17. )
  18. );
  19. return ab + bc + ca;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement