Advertisement
Guest User

Untitled

a guest
Mar 31st, 2020
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. public static double CalculateArea (List<Point> pointList)
  2. {
  3. double area = 0;
  4. int n = pointList.size() - 1;
  5. Point a = pointList.get(0);
  6. pointList.add(a);
  7. for(int i = 0; i<n; i++)
  8. {
  9. area+= 0.5(pointList.get(i).getX()pointList.get(i+1).getY() - pointList.get(i+1).getX()*pointList.get(i).getY());
  10. }
  11. return Math.abs(area);
  12.  
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement