public class Circle extends Point implements Cloneable
Constructor and Description |
---|
Circle(Circle p)
Copy constructor
|
Circle(double[] p,
double radius)
Constructor
|
Circle(double x,
double y,
double radius)
Constructor
|
Modifier and Type | Method and Description |
---|---|
Point |
clone()
Implements the Cloneable interface
|
double |
getDistance(double x2,
double y2)
Computes the distance between this circle and a point
|
double |
getDistance(double centerX,
double centerY,
double radius)
Computes the distance from the Geometry object to a Circle
|
double |
getDistance(double x1,
double y1,
double x2,
double y2)
Computes the distance between this point and a line segment
|
double |
getRadius() |
void |
setRadius(double newRadius)
Sets the radius of the circle
|
String |
toString()
Generates a string representation of the Circle object
|
getDirectionTo, getDirectionTo, getDirectionTo, getX, getY, setCoordinates, setCoordinates, setCoordinates, setX, setY
determinant, dotProduct, getClosestPointOnLine, getClosestPointOnSegment, getDirectionTo, getDirectionTo, getDirectionTo, getDirectionTo, getDirectionTo, getDirectionTo, getDirectionTo, getDistance, getDistance, getDistance, getDistance, getDistance, getDistance, getDistance, getDistance, getIntersectPoint, isInSegment, isOnSegment, pointDirection, pointDistance
public Circle(double x, double y, double radius)
public Circle(double[] p, double radius)
public Circle(Circle p)
public double getRadius()
public void setRadius(double newRadius)
newRadius
- the new radius (meters) of the circle (will use the absolute value)public double getDistance(double x2, double y2)
getDistance
in class Point
x2
- x coordinate of the point being testedy2
- y coordinate of the point being testedpublic double getDistance(double centerX, double centerY, double radius)
getDistance
in class Point
centerX
- north/south coordinate of the circle being testedcenterY
- east/west coordinate of the circle being testedradius
- of the circle being testedpublic double getDistance(double x1, double y1, double x2, double y2)
getDistance
in class Point
x1
- north/south coordinate of the first segment end pointy1
- east west coordinate of the first segment end pointx2
- north/south coordinate of the second segment end pointy2
- east west coordinate of the second segment end point