Treeviz 0.37 2010-10-17

ch.randelshofer.tree.circlemap
Class Circle

java.lang.Object
  extended by ch.randelshofer.tree.circlemap.Circle
All Implemented Interfaces:
java.lang.Cloneable
Direct Known Subclasses:
CirclemapNode

public class Circle
extends java.lang.Object
implements java.lang.Cloneable

Describes a Circle by its radius and the location of its center.

Version:
1.0 Jan 17, 2008 Created.
Author:
Werner Randelshofer

Field Summary
 double cx
           
 double cy
           
 double radius
           
 
Constructor Summary
Circle()
          Creates a new circle at location 0,0 and a radius of 0.
Circle(double cx, double cy, double r)
          Creates a new circle with the specified coordinates and radius.
 
Method Summary
 Circle clone()
           
 boolean contains(Circle that)
          Returns true, if this circle contains that circle.
 boolean contains(Circle that, double error)
           
 boolean contains(double px, double py)
          Returns true, if this circle contains the specified point.
 double getCX()
          Returns the x-coordinate of the center of the circle.
 double getCY()
          Returns the y-coordinate of the center of the circle.
 double getIntersectionRadius(Circle that)
          Returns true, if this circle intersects that circle.
 double getRadius()
          Returns the radius of the circle.
 boolean intersects(Circle that)
          Returns true, if this circle intersects that circle.
 boolean intersects(Circle that, double error)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

cx

public double cx

cy

public double cy

radius

public double radius
Constructor Detail

Circle

public Circle()
Creates a new circle at location 0,0 and a radius of 0.


Circle

public Circle(double cx,
              double cy,
              double r)
Creates a new circle with the specified coordinates and radius.

Method Detail

getRadius

public double getRadius()
Returns the radius of the circle.


getCX

public double getCX()
Returns the x-coordinate of the center of the circle.

Returns:
the x-coordinate of the center.

getCY

public double getCY()
Returns the y-coordinate of the center of the circle.

Returns:
the y-coordinate of the center.

intersects

public boolean intersects(Circle that)
Returns true, if this circle intersects that circle.


intersects

public boolean intersects(Circle that,
                          double error)

getIntersectionRadius

public double getIntersectionRadius(Circle that)
Returns true, if this circle intersects that circle.


contains

public boolean contains(Circle that)
Returns true, if this circle contains that circle.


contains

public boolean contains(Circle that,
                        double error)

contains

public boolean contains(double px,
                        double py)
Returns true, if this circle contains the specified point.


toString

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

clone

public Circle clone()
Overrides:
clone in class java.lang.Object

Copyright 2007-2008 (c) Werner Randelshofer.
All rights reserved.