jdsl.geomobj.ref
Class RatCircle2D

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

public class RatCircle2D
extends AbstractCircle2D
implements Circle2D

A two-dimensional circle constructed using three integer or rational points.

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

Inner classes inherited from class jdsl.geomobj.api.GeomObject2D
GeomObject2D.NoneGeomObject2D
 
Field Summary
protected  RatPoint2D p1_
           
protected  RatPoint2D p2_
           
protected  RatPoint2D 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
RatCircle2D(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()
          Computes the center of the circle as the point simultaneously equidistant from p1_ and p2_, and from p2_ and p3_
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 RatPoint2D p1_

p2_

protected RatPoint2D p2_

p3_

protected RatPoint2D p3_
Constructor Detail

RatCircle2D

public RatCircle2D(Point2D p1,
                   Point2D p2,
                   Point2D p3)
            throws InvalidPointException
Parameters:
p1 - a point of the circle; must be an integer or rational point
p2 - a second point of the circle; must be an integer or rational point distinct from a
p3 - a third point of the circle; must be an integer or rational point distinct from a and b
Throws:
InvalidPointException - if p1, p2, and p3 are not integer or rational 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()
Computes the center of the circle as the point simultaneously equidistant from p1_ and p2_, and from p2_ and p3_
Overrides:
computeCenter in class AbstractCircle2D

computeSqRadius

protected void computeSqRadius()
Overrides:
computeSqRadius in class AbstractCircle2D