physics
Class Circle

java.lang.Object
  extended by physics.Circle
All Implemented Interfaces:
java.io.Serializable

public final class Circle
extends java.lang.Object
implements java.io.Serializable

Circle is an immutable abstract data type which models the mathematical notion of a circle in cartesian space.

See Also:
Serialized Form

Constructor Summary
Circle(double cx, double cy, double r)
           
Circle(java.awt.geom.Point2D center, double r)
           
Circle(Vect center, double r)
           
 
Method Summary
 boolean equals(Circle c)
           
 boolean equals(java.lang.Object o)
           
 Vect getCenter()
           
 double getRadius()
           
 int hashCode()
           
 java.awt.geom.Ellipse2D toEllipse2D()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Circle

public Circle(Vect center,
              double r)
Parameters:
center - the center point of the circle
r - the radius of the circle

Circle

public Circle(double cx,
              double cy,
              double r)
Parameters:
cx - the x coordinate of the center point of the circle
cy - the y coordinate of the center point of the circle
r - the radius of the circle

Circle

public Circle(java.awt.geom.Point2D center,
              double r)
Parameters:
center - the center point of the circle
r - the radius of the circle
Method Detail

getCenter

public Vect getCenter()
Returns:
the center point of this circle.

getRadius

public double getRadius()
Returns:
the radius of this circle.

toEllipse2D

public java.awt.geom.Ellipse2D toEllipse2D()
Returns:
a new Ellipse2D which is the same as this circle

equals

public boolean equals(Circle c)

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object