org.geotools.geometry.iso.util.elem2D
Class Circle2D

java.lang.Object
  extended by org.geotools.geometry.iso.util.elem2D.Circle2D

public class Circle2D
extends java.lang.Object

Author:
Jackson Roehrig & Sanjay Jena Circle2D A circle, representated by a X- and Y- Coordinate and a radius r. This class provides a constructor building a unique circle from 3 points. This class was translated from CPP into Java The original source code can be found at http://astronomy.swin.edu.au/~pbourke/geometry/circlefrom3/

Constructor Summary
Circle2D(double centerX, double centerY, double radius)
           
Circle2D(java.awt.geom.Point2D pt1, java.awt.geom.Point2D pt2, java.awt.geom.Point2D pt3)
          Constructs a circle from three points
 
Method Summary
 boolean contains(java.awt.geom.Point2D dp)
          Verifies weather the circle contains a node or not.
 java.awt.geom.Point2D getCenter()
           
 double getRadius()
           
 java.awt.geom.Rectangle2D getRectangle()
           
 double getX()
           
 double getY()
           
 void setRadius(double radius)
           
 void setValues(double x, double y, double radius)
           
 void setX(double x)
           
 void setY(double y)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Circle2D

public Circle2D(double centerX,
                double centerY,
                double radius)

Circle2D

public Circle2D(java.awt.geom.Point2D pt1,
                java.awt.geom.Point2D pt2,
                java.awt.geom.Point2D pt3)
Constructs a circle from three points

Parameters:
First - node
Second - node
Thirs - node
Method Detail

getX

public double getX()
Returns:

getY

public double getY()
Returns:

getRadius

public double getRadius()
Returns:

getCenter

public java.awt.geom.Point2D getCenter()
Returns:

setRadius

public void setRadius(double radius)
Parameters:
radius - The radius to set.

setX

public void setX(double x)
Parameters:
x - The x to set.

setY

public void setY(double y)
Parameters:
y - The y to set.

setValues

public void setValues(double x,
                      double y,
                      double radius)

contains

public boolean contains(java.awt.geom.Point2D dp)
Verifies weather the circle contains a node or not. Point laying at the border of the circle are not contained by the circle.

Parameters:
dp -
Returns:

getRectangle

public java.awt.geom.Rectangle2D getRectangle()

toString

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


Copyright © 1996-2010 Geotools. All Rights Reserved.