Here you can find the source of polyArea(Polygon target)
public static int polyArea(Polygon target)
//package com.java2s; //License from project: Open Source License import java.awt.Polygon; public class Main { public static int polyArea(Polygon target) { int sum = 0; for (int i = 0; i < target.npoints; i++) { sum = sum + target.xpoints[i] * target.ypoints[(i + 1) % target.npoints] - target.ypoints[i] * target.xpoints[(i + 1) % target.npoints]; }/*from w w w . j a v a 2 s . c o m*/ return Math.abs(sum / 2); } }