@Test public void testContainsShape() { Shape shape = new Circle(2f); Assert.assertEquals(true, circle1.contains(shape)); shape = new Rectangle(0f,0f,1f,1f); Assert.assertEquals(true, circle1.contains(shape)); shape = new Rectangle(0f,0f,3f,3f); Assert.assertEquals(false, circle1.contains(shape)); shape = new Triangle(new Vector2(0f, 4f), new Vector2(-4f,0f), new Vector2(4f,0f)); Assert.assertEquals(true,circle1.contains(shape)); shape = new Triangle(new Vector2(0f, 5f), new Vector2(-4f,0f), new Vector2(4f,0f)); Assert.assertEquals(false,circle1.contains(shape)); }
@Override public boolean contains(Vector2 point) { return contains(point.x, point.y); }
Circle extends Shape { @Override public boolean contains(Vector2 point) { return contains(point.x, point.y); } }
Circle extends Shape { @Override public boolean contains(Vector2 point) { return contains(point.x, point.y); } Circle(Geometry geometry);  Circle(float radius);  Circle(float centerX, float centerY, float radius);  Circle(Circle circle); }
Circle extends Shape { @Override public boolean contains(Vector2 point) { return contains(point.x, point.y); } Circle(Geometry geometry);  Circle(float radius);  Circle(float centerX, float centerY, float radius);  Circle(Circle circle); @Override void dispose(); @Override Shape copy(); Circle lerp(Circle target, float alpha); void lerp(Circle result, Circle target, float alpha); static void lerp(Circle result, Circle from, Circle target, float alpha); @Override boolean contains(Vector2 point); @Override boolean contains(float x, float y); @Override boolean contains(Sizeable shape); boolean contains(Circle circle); boolean contains(Rectangle rectangle); boolean contains(Polygon polygon); @Override boolean intersects(Sizeable shape); @Override boolean intersectsLineSegment(Vector2 pointA, Vector2 pointB); @Override boolean intersectsLineSegment(float x1, float y1, float x2, float y2); @Override float getWidth(); @Override float getHeight(); boolean intersects(Rectangle rectangle); boolean intersects(Circle circle); float getDistanceTo(float x, float y); float getDistanceFromCenter(Vector2 point); float getDistanceFromCenter(float x, float y); @Override int getNumberOfSides(); @Override void draw(Graphics g); @Override void fill(Graphics g); void set(Circle circle); @Override float getX(); @Override float getY(); @Override void setX(float x); @Override void setY(float y); @Override float getCenterX(); @Override float getCenterY(); @Override void setCenter(float x, float y); @Override void setCenterX(float x); @Override void setCenterY(float y); @Override void setXY(float x, float y); @Override float getMinX(); @Override float getMinY(); @Override float getMaxX(); @Override float getMaxY(); float getRadius(); void setRadius(float radius); @Override void scale(float scale); @Override void translate(float translateX, float translateY); @Override EdgeIterator edgeIterator(); Rectangle getBoundingBox(); @Override float getRotation(); @Override void setRotation(float degrees); @Override void setRotationAround(float centerX, float centerY, float degrees); @Override void rotate(float degrees); @Override void rotateAround(float centerX, float centerY, float degrees); @Override boolean isCircle(); @Override Polygon getPolygon(); @Override int hashCode(); @Override boolean equals(Object obj); }
Circle extends Shape { @Override public boolean contains(Vector2 point) { return contains(point.x, point.y); } Circle(Geometry geometry);  Circle(float radius);  Circle(float centerX, float centerY, float radius);  Circle(Circle circle); @Override void dispose(); @Override Shape copy(); Circle lerp(Circle target, float alpha); void lerp(Circle result, Circle target, float alpha); static void lerp(Circle result, Circle from, Circle target, float alpha); @Override boolean contains(Vector2 point); @Override boolean contains(float x, float y); @Override boolean contains(Sizeable shape); boolean contains(Circle circle); boolean contains(Rectangle rectangle); boolean contains(Polygon polygon); @Override boolean intersects(Sizeable shape); @Override boolean intersectsLineSegment(Vector2 pointA, Vector2 pointB); @Override boolean intersectsLineSegment(float x1, float y1, float x2, float y2); @Override float getWidth(); @Override float getHeight(); boolean intersects(Rectangle rectangle); boolean intersects(Circle circle); float getDistanceTo(float x, float y); float getDistanceFromCenter(Vector2 point); float getDistanceFromCenter(float x, float y); @Override int getNumberOfSides(); @Override void draw(Graphics g); @Override void fill(Graphics g); void set(Circle circle); @Override float getX(); @Override float getY(); @Override void setX(float x); @Override void setY(float y); @Override float getCenterX(); @Override float getCenterY(); @Override void setCenter(float x, float y); @Override void setCenterX(float x); @Override void setCenterY(float y); @Override void setXY(float x, float y); @Override float getMinX(); @Override float getMinY(); @Override float getMaxX(); @Override float getMaxY(); float getRadius(); void setRadius(float radius); @Override void scale(float scale); @Override void translate(float translateX, float translateY); @Override EdgeIterator edgeIterator(); Rectangle getBoundingBox(); @Override float getRotation(); @Override void setRotation(float degrees); @Override void setRotationAround(float centerX, float centerY, float degrees); @Override void rotate(float degrees); @Override void rotateAround(float centerX, float centerY, float degrees); @Override boolean isCircle(); @Override Polygon getPolygon(); @Override int hashCode(); @Override boolean equals(Object obj);  }