csjs.shapes
Class GeoCircle

java.lang.Object
  |
  +--csjs.shapes.Shape
        |
        +--csjs.shapes.GeoShape
              |
              +--csjs.shapes.GeoCircle
All Implemented Interfaces:
CircleADT, GeoCircleADT, ShapeADT

public class GeoCircle
extends GeoShape
implements GeoCircleADT

A 'geocircle' a circle located in 2-space


Constructor Summary
GeoCircle(double r, csjs.math.Point p)
          Create a circle.
 
Method Summary
 double area()
          Returns the area of this geocircle.
 double diameter()
          Returns the diameter of this geocircle.
 double distance(GeoCircle gc)
          Returns the Cartesian distance between the receiving point and that given by the parameter.
 boolean equals(GeoCircle gc)
          Returns true if the revieving geocircle and the parameter geocircle are equal; false if not.
 void expand(double a)
          Expand this geocircle by augmenting its radius by the given number.
 double perimeter()
          Returns the circumference of this geocircle.
 csjs.math.Point point()
          Returns the point of this geocircle.
 double radius()
          Returns the radius of this geocircle.
 void resize(double s)
          Set the radius of the geocircle to the given number
 void set(csjs.math.Point p)
          Sets the coordinates of the point
 void shrink(double a)
          Shrink this geocircle by diminishing its radius by the given number.
 java.lang.String toString()
          Write a description of this geocircle to the standard output file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GeoCircle

public GeoCircle(double r,
                 csjs.math.Point p)
Create a circle.

Parameters:
r - the radius of the geocircle
p - the point of the geocircle
Method Detail

radius

public double radius()
Returns the radius of this geocircle.

Specified by:
radius in interface CircleADT

point

public csjs.math.Point point()
Returns the point of this geocircle.

Specified by:
point in interface GeoCircleADT

diameter

public double diameter()
Returns the diameter of this geocircle.

Specified by:
diameter in interface CircleADT

area

public double area()
Returns the area of this geocircle.

Specified by:
area in interface ShapeADT

perimeter

public double perimeter()
Returns the circumference of this geocircle.

Specified by:
perimeter in interface ShapeADT

toString

public java.lang.String toString()
Write a description of this geocircle to the standard output file.

Specified by:
toString in interface ShapeADT
Overrides:
toString in class java.lang.Object

expand

public void expand(double a)
Expand this geocircle by augmenting its radius by the given number.

Specified by:
expand in interface CircleADT
Parameters:
a - amount by which the geocircle is expanded

shrink

public void shrink(double a)
Shrink this geocircle by diminishing its radius by the given number.

Specified by:
shrink in interface CircleADT
Parameters:
a - amount by which the geocircle is contracted

resize

public void resize(double s)
Set the radius of the geocircle to the given number

Specified by:
resize in interface CircleADT
Parameters:
s - size, in terms of radius, to which the geocircle is set

distance

public double distance(GeoCircle gc)
Returns the Cartesian distance between the receiving point and that given by the parameter.

Specified by:
distance in interface GeoCircleADT

equals

public boolean equals(GeoCircle gc)
Returns true if the revieving geocircle and the parameter geocircle are equal; false if not.

Specified by:
equals in interface GeoCircleADT
Parameters:
gc - the "other" geocircle

set

public void set(csjs.math.Point p)
Sets the coordinates of the point

Specified by:
set in interface GeoCircleADT
Parameters:
p - the point