title: Rotate Rectangle in Java
body: <p>I need to create rectangles that are rotated around their center (so they don't need to be parallel to the axes of the coordinate system). So basicelly each rectangle can be defined by <strong>center-X</strong>, <strong>center-Y</strong>, <strong>width</strong>, <strong>height</strong> and <strong>angle</strong>. What I want to do then is to perform calculations on whether certain points are contained in these rectangles or not (so no drawing will be involved). I guess I cant use the <code>Rectangle2D</code> class because these rectangles will always be parallel to the x and y-axis of the coordinate system. Is the only way to get this functionality by writing my own rectangle class or is there anything existing (similar to <code>Rectangle2D</code>) I can use?</p>