physics
Class Circle
java.lang.Object
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)
|
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Circle
public Circle(Vect center,
double r)
- Parameters:
center - the center point of the circler - 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 circlecy - the y coordinate of the center point of the circler - the radius of the circle
Circle
public Circle(java.awt.geom.Point2D center,
double r)
- Parameters:
center - the center point of the circler - the radius of the circle
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