@Test public void testIntersectsCircle() { rectangle1 = new Rectangle(0f, 0f, 50f, 50f); Circle intersectingCircle = new Circle(75f, 75f, 50f); Circle nonIntersectingCircle = new Circle(500f, 500f, 50f); Assert.assertTrue(rectangle1.intersects(intersectingCircle)); Assert.assertFalse(rectangle1.intersects(nonIntersectingCircle)); }
@Override public boolean intersects(Sizeable shape) { return polygon.intersects(shape); }
Rectangle extends Shape { @Override public boolean intersects(Sizeable shape) { return polygon.intersects(shape); } }
Rectangle extends Shape { @Override public boolean intersects(Sizeable shape) { return polygon.intersects(shape); } Rectangle();  Rectangle(Geometry geometry);  Rectangle(float x, float y, float width, float height);  Rectangle(Rectangle rectangle); }
Rectangle extends Shape { @Override public boolean intersects(Sizeable shape) { return polygon.intersects(shape); } Rectangle();  Rectangle(Geometry geometry);  Rectangle(float x, float y, float width, float height);  Rectangle(Rectangle rectangle); @Override void dispose(); @Override Shape copy(); @Override boolean contains(float x, float y); @Override boolean contains(Vector2 point); @Override boolean contains(Sizeable shape); boolean contains(Rectangle rectangle); boolean contains(Circle circle); @Override boolean intersects(Sizeable shape); boolean intersects(Circle circle); boolean intersects(Rectangle rectangle); boolean intersects(float x, float y, float width, float height); boolean intersects(Triangle triangle); boolean intersects(Polygon polygon); @Override boolean intersectsLineSegment(Vector2 pointA, Vector2 pointB); @Override boolean intersectsLineSegment(float x1, float y1, float x2, float y2); Rectangle intersection(Rectangle rect); @Override int getNumberOfSides(); @Override void draw(Graphics g); @Override void fill(Graphics g); Rectangle lerp(Rectangle target, float alpha); Rectangle lerp(Rectangle result, Rectangle target, float alpha); static void lerp(Rectangle result, Rectangle from, Rectangle target, float alpha); float getDistanceTo(float x, float y); @Override float getRotation(); @Override void setRotation(float degrees); @Override void rotate(float degrees); @Override void rotateAround(float centerX, float centerY, float degrees); @Override void setRotationAround(float centerX, float centerY, float degrees); Rectangle set(float x, float y, float width, float height); void set(Rectangle rectangle); void setXY(float x, float y); void setXY(Vector2 position); @Override float getX(); void setX(float x); @Override float getY(); void setY(float y); float getWidth(); Rectangle setWidth(float width); float getHeight(); Rectangle setHeight(float height); Rectangle setSize(float width, float height); Rectangle setSize(float sizeXY); @Override void setRadius(float radius); @Override void scale(float scale); @Override void translate(float translateX, float translateY); @Override EdgeIterator edgeIterator(); float getCenterX(); float getCenterY(); @Override void setCenter(float x, float y); @Override void setCenterX(float x); @Override void setCenterY(float y); float getMinX(); float getMinY(); float getMaxX(); float getMaxY(); float [] getVertices(); @Override String toString(); @Override boolean isCircle(); @Override Polygon getPolygon(); @Override int hashCode(); @Override boolean equals(Object obj); }
Rectangle extends Shape { @Override public boolean intersects(Sizeable shape) { return polygon.intersects(shape); } Rectangle();  Rectangle(Geometry geometry);  Rectangle(float x, float y, float width, float height);  Rectangle(Rectangle rectangle); @Override void dispose(); @Override Shape copy(); @Override boolean contains(float x, float y); @Override boolean contains(Vector2 point); @Override boolean contains(Sizeable shape); boolean contains(Rectangle rectangle); boolean contains(Circle circle); @Override boolean intersects(Sizeable shape); boolean intersects(Circle circle); boolean intersects(Rectangle rectangle); boolean intersects(float x, float y, float width, float height); boolean intersects(Triangle triangle); boolean intersects(Polygon polygon); @Override boolean intersectsLineSegment(Vector2 pointA, Vector2 pointB); @Override boolean intersectsLineSegment(float x1, float y1, float x2, float y2); Rectangle intersection(Rectangle rect); @Override int getNumberOfSides(); @Override void draw(Graphics g); @Override void fill(Graphics g); Rectangle lerp(Rectangle target, float alpha); Rectangle lerp(Rectangle result, Rectangle target, float alpha); static void lerp(Rectangle result, Rectangle from, Rectangle target, float alpha); float getDistanceTo(float x, float y); @Override float getRotation(); @Override void setRotation(float degrees); @Override void rotate(float degrees); @Override void rotateAround(float centerX, float centerY, float degrees); @Override void setRotationAround(float centerX, float centerY, float degrees); Rectangle set(float x, float y, float width, float height); void set(Rectangle rectangle); void setXY(float x, float y); void setXY(Vector2 position); @Override float getX(); void setX(float x); @Override float getY(); void setY(float y); float getWidth(); Rectangle setWidth(float width); float getHeight(); Rectangle setHeight(float height); Rectangle setSize(float width, float height); Rectangle setSize(float sizeXY); @Override void setRadius(float radius); @Override void scale(float scale); @Override void translate(float translateX, float translateY); @Override EdgeIterator edgeIterator(); float getCenterX(); float getCenterY(); @Override void setCenter(float x, float y); @Override void setCenterX(float x); @Override void setCenterY(float y); float getMinX(); float getMinY(); float getMaxX(); float getMaxY(); float [] getVertices(); @Override String toString(); @Override boolean isCircle(); @Override Polygon getPolygon(); @Override int hashCode(); @Override boolean equals(Object obj);  }