jdsl.geomobj.ref
Class IntCircle2D

java.lang.Object
  |
  +--jdsl.geomobj.ref.AbstractGeomObject2D
        |
        +--jdsl.geomobj.ref.AbstractCircle2D
              |
              +--jdsl.geomobj.ref.IntCircle2D
All Implemented Interfaces:
Circle2D, ClosedCurve2D, Curve2D, GeomObject, GeomObject2D

public class IntCircle2D
extends AbstractCircle2D
implements Circle2D

This is the class for a two-dimensional circle constructed using three integer points.

Version:
$Id: IntCircle2D.java,v 1.5 2001/05/16 13:44:56 lv Exp $
Author:
Masi Oka (mao), Luca Vismara (lv)

Inner classes inherited from class jdsl.geomobj.api.GeomObject2D
GeomObject2D.NoneGeomObject2D
 
Field Summary
protected  IntPoint2D p1_
           
protected  IntPoint2D p2_
           
protected  IntPoint2D p3_
           
 
Fields inherited from class jdsl.geomobj.ref.AbstractCircle2D
approxSqRadius_, approxSqRadius_computed_, center_, sqRadius_, sqRadius_computed_, sqRadius_denom_, sqRadius_num_
 
Fields inherited from class jdsl.geomobj.ref.AbstractGeomObject2D
gt, jn
 
Fields inherited from interface jdsl.geomobj.api.GeomObject2D
NONE
 
Constructor Summary
IntCircle2D(Point2D p1, Point2D p2, Point2D p3)
           
 
Method Summary
 int arithmeticType()
          The arithmetic type of a geometric object is encoded as an integer number.
protected  void computeCenter()
           
protected  void computeSqRadius()
           
 boolean equals(java.lang.Object obj)
           
 Point2D[] points()
           
 java.lang.String toString()
           
 
Methods inherited from class jdsl.geomobj.ref.AbstractCircle2D
center, squaredRadius
 
Methods inherited from class jdsl.geomobj.ref.AbstractGeomObject2D
dim
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface jdsl.geomobj.api.Circle2D
center, squaredRadius
 
Methods inherited from interface jdsl.geomobj.api.GeomObject
dim
 

Field Detail

p1_

protected IntPoint2D p1_

p2_

protected IntPoint2D p2_

p3_

protected IntPoint2D p3_
Constructor Detail

IntCircle2D

public IntCircle2D(Point2D p1,
                   Point2D p2,
                   Point2D p3)
            throws InvalidPointException
Parameters:
p1 - a point of the circle; must be an integer point
p2 - a second point of the circle; must be an integer point distinct from p1
p3 - a third point of the circle; must be an integer point distinct from p1 and p2
Throws:
InvalidPointException - if p1, p2, and p3 are not integer points, or if p1, p2, and p3 are not distinct, or if p1, p2, and p3 are collinear
Method Detail

equals

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

toString

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

arithmeticType

public int arithmeticType()
Description copied from interface: GeomObject
The arithmetic type of a geometric object is encoded as an integer number. Current legal values are: 0 = an integer geometric object 1 = a rational geometric object
Specified by:
arithmeticType in interface GeomObject
Following copied from interface: jdsl.geomobj.api.GeomObject
Returns:
the arithmetic type of this

points

public Point2D[] points()
Specified by:
points in interface ClosedCurve2D
Following copied from interface: jdsl.geomobj.api.ClosedCurve2D
Returns:
an array of points defining this; the points are in clockwise order

computeCenter

protected void computeCenter()
Overrides:
computeCenter in class AbstractCircle2D

computeSqRadius

protected void computeSqRadius()
Overrides:
computeSqRadius in class AbstractCircle2D