gizmoball.shape
Class Circle09

java.lang.Object
  extended by gizmoball.shape.Circle09
All Implemented Interfaces:
Shape

public class Circle09
extends java.lang.Object
implements Shape

This class represents a circle object with positive radius, implementing the Shape interface

Author:
Eitan Reich

Constructor Summary
Circle09(Circle c)
          Constructs an Circle09 object from a Circle object with positive radius
Circle09(double cx, double cy, double r)
          Constructs a circle given center coordinates and positive radius
Circle09(java.awt.geom.Point2D center, double r)
          Constructs circle given center Point2D and positive radius
Circle09(Vect center, double r)
          Constructs a circle given center vector and positive radius
 
Method Summary
 boolean containsPoint(Vect pt)
           
 Vect getCenter()
           
 java.util.List<Circle> getCircles()
          returns a list of circles in the object, consisting of the one circle object itself
 java.util.List<LineSegment> getLineSegments()
          returns a list of edges in the object, consisting of the empty list
 double getRadius()
           
 Vect maxXY()
          Returns the maximum coordinates for a bounding rectangle around the circle
 Vect minXY()
          Returns the minimum coordinates for a bounding rectangle around the circle
 Circle09 rotate(Angle theta, Vect centerOfRotation)
          rotates the circle by angle theta about a point and returns the new circle
 Circle09 translate(Vect v)
          translates the circle by vector v and returns the new circle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Circle09

public Circle09(double cx,
                double cy,
                double r)
Constructs a circle given center coordinates and positive radius

Parameters:
cx - x-coordinate of center
cy - y-coordinate of center
r - radius

Circle09

public Circle09(Vect center,
                double r)
Constructs a circle given center vector and positive radius

Parameters:
center - vector center of circle
r - radius

Circle09

public Circle09(java.awt.geom.Point2D center,
                double r)
Constructs circle given center Point2D and positive radius

Parameters:
center - Point2D at center of circle
r - radius

Circle09

public Circle09(Circle c)
Constructs an Circle09 object from a Circle object with positive radius

Parameters:
c -
Method Detail

minXY

public Vect minXY()
Returns the minimum coordinates for a bounding rectangle around the circle

Specified by:
minXY in interface Shape
Returns:
the minimum coordinates for a bounding rectangle of the shape

maxXY

public Vect maxXY()
Returns the maximum coordinates for a bounding rectangle around the circle

Specified by:
maxXY in interface Shape
Returns:
the maximum coordinates for a bounding rectangle of the shape

getRadius

public double getRadius()
Returns:
radius of circle

getCenter

public Vect getCenter()
Returns:
center of circle

containsPoint

public boolean containsPoint(Vect pt)
Specified by:
containsPoint in interface Shape

getCircles

public java.util.List<Circle> getCircles()
returns a list of circles in the object, consisting of the one circle object itself

Specified by:
getCircles in interface Shape
Returns:
List list of Circle objects

getLineSegments

public java.util.List<LineSegment> getLineSegments()
returns a list of edges in the object, consisting of the empty list

Specified by:
getLineSegments in interface Shape
Returns:
List list of LineSegment objects

rotate

public Circle09 rotate(Angle theta,
                       Vect centerOfRotation)
rotates the circle by angle theta about a point and returns the new circle

Specified by:
rotate in interface Shape
Parameters:
theta - angle to rotate
centerOfRotation - point to rotate around
Returns:
shape rotated around centerOfRotation by angle theta

translate

public Circle09 translate(Vect v)
translates the circle by vector v and returns the new circle

Specified by:
translate in interface Shape
Parameters:
v - vector to translate shape by
Returns:
shape translated by v