Convex: Polygons with angles less than 180 degrees.
Finding Convex Hull problem: Given points, find the smallest convex polygon that contains all points.
Graham Scan
Convex Hull Trick
Line2D line = new Line2D.Double(x1, y1, x2, y2)
Point2D point = new Point2D.Double(x, y);
line.ptLineDist(point);
line.ptLineDist(point);
line1.intersectsLine(line2);
line.relativeCCW(point);
Point2D point = new Point2D.Double(x, y);
AffineTransform rotate = AffineTransform.getRotateInstance(theta, x0, y0);
point = rotate.transform(point, null);
Rectangle rectangle1 = new Rectangle(x1, y1, x2, y2)
Rectangle rectangle2 = new Rectangle(x3, y3, x4, y4)
Rectangle intersection = rectangle1.intersection(rectangle2)
Polygon polygon = new Polygon();
polygon.addPoint(x1, y1);
polygon.addPoint(x2, y2);
polygon.addPoint(x3, y3);
polygon.contains(point)
Area area = new Area();
area.add(new Area(polygon));
area.add(new Area(triangle));
area.add(new Area(rectangle));
area.contains(new Rectangle(x, y, w, h))