Are there any good 2D geometry libraries for Java? I’m looking for anything that can work with “rotatable boxes” and can help me answering the questions like:
- Do these 2 boxes intersect?
- Is this point inside that box?
- What are the bounds for this set of boxes
etc. Nothing related with rendering required. The code is like:
Box a = new Box(0, 0, 100, 50); // center at (0,0) size is (100,50)
Box b = new Box(50, 50, 50, 100);
b.setRotation(45);
Box boundingBox = Algo.getBoundingBox(a, b);
...
Try this one:
http://www.vividsolutions.com/jts/jtshome.htm