code: private static double cross(Coordinate a1, Coordinate a2, Coordinate b1, Coordinate b2) {
  		return (a2.getX() - a1.getX()) * (b2.getY() - b1.getY()) - (a2.getY() - a1.getY()) * (b2.getX() - b1.getX());
  	}
docs: cross-product of 2 vectors