public class Circle2D extends Ellipse2D implements Cloneable, CirculinearElement2D, CirculinearBoundary2D, CircularShape2D, CircleLine2D
Conic2D.Type| Modifier and Type | Field and Description |
|---|---|
protected double |
r
the radius of the circle.
|
| Constructor and Description |
|---|
Circle2D()
Empty constructor: center 0,0 and radius 0.
|
Circle2D(double xcenter,
double ycenter,
double radius)
Create a new circle with specified center and radius
|
Circle2D(double xcenter,
double ycenter,
double radius,
boolean direct)
Create a new circle with specified center, radius and orientation.
|
Circle2D(Point2D center,
double radius)
Create a new circle with specified point center and radius
|
Circle2D(Point2D center,
double radius,
boolean direct)
Create a new circle with specified center, radius and orientation
|
| Modifier and Type | Method and Description |
|---|---|
GeneralPath |
appendPath(GeneralPath path)
Add the path of the ellipse to the given path.
|
CurveSet2D<? extends CircularShape2D> |
clip(Box2D box)
Clip the circle by a box.
|
Circle2D |
clone()
Overrides Object declaration to ensure Curve2D implementation are
cloned as Curve2D.
|
boolean |
contains(double x,
double y)
Return true if the point (x, y) lies exactly on the circle.
|
static Circle2D |
create(Point2D center,
double radius)
Creates a circle from a center and a radius.
|
static Circle2D |
create(Point2D p1,
Point2D p2,
Point2D p3)
Creates a circle containing 3 points.
|
void |
draw(Graphics2D g2)
Draws the curve on the given Graphics2D object.
|
boolean |
equals(Object obj) |
CirculinearDomain2D |
getBuffer(double dist)
Computes the buffer of the shape, formed by the set of points located
at a distance from the shape that is lower or equal to d.
|
double[] |
getConicCoefficients()
Returns Cartesian equation of the circle:
|
Conic2D.Type |
getConicType() |
Collection<? extends Circle2D> |
getContinuousCurves()
Returns the collection of continuous curves which constitute this curve.
|
double |
getDistance(double x,
double y)
get the distance of the shape to the given point, specified by x and y,
or the distance of point to the frontier of the shape in the case of a
plain (i.e.
|
double |
getDistance(Point2D point)
get the distance of the shape to the given point, or the distance of
point to the frontier of the shape in the case of a plain shape.
|
double |
getEccentricity()
Return 0, which is the eccentricity of a circle by definition.
|
Point2D |
getFirstPoint()
Get the first point of the circle, which is the same as the last point.
|
Point2D |
getFocus1()
Return the first focus, which for a circle is the same point as the
center.
|
Point2D |
getFocus2()
Return the second focus, which for a circle is the same point as the
center.
|
static Collection<Point2D> |
getIntersections(Circle2D circle1,
Circle2D circle2) |
static Collection<Point2D> |
getIntersections(CircularShape2D circle,
LinearShape2D line)
Compute intersections of a circle with a line.
|
Collection<Point2D> |
getIntersections(LinearShape2D line)
Compute intersections of the circle with a line.
|
Point2D |
getLastPoint()
Get the last point of the circle, which is the same as the first point.
|
double |
getLength()
Returns perimeter of the circle (equal to 2*PI*radius).
|
double |
getLength(double pos) |
Circle2D |
getParallel(double d)
Returns the parallel circle located at a distance d from this circle.
|
Point2D |
getPoint(double t)
Get the position of the curve from internal parametric representation,
depending on the parameter t.
|
double |
getPosition(double length) |
double |
getPosition(Point2D point)
Get position of the point on the curve.
|
double |
getRadius() |
Circle2D |
getReverseCurve()
Returns the circle with same center and same radius, but with the other
orientation.
|
double |
getSignedDistance(double x,
double y)
The same as getSignedDistance(Point2D), but by passing 2 double as
arguments.
|
double |
getSignedDistance(Point2D point)
Get the signed distance of the curve to the given point: this distance is
positive if the point lies outside the shape, and is negative if the
point lies inside the shape.
|
Collection<? extends Circle2D> |
getSmoothPieces()
Returns a set of smooth curves, which contains only the circle.
|
CircleArc2D |
getSubCurve(double t0,
double t1)
Returns a new CircleArc2D.
|
Circle2D |
getSupportingCircle()
Returns the circle itself.
|
Vector2D |
getTangent(double t) |
boolean |
isCircle() |
boolean |
isInside(Point2D point)
Test whether the point is inside the circle.
|
void |
setCircle(double xc,
double yc,
double r)
Deprecated.
conics will become immutable in a future release
|
void |
setCircle(Point2D center,
double r)
Deprecated.
conics will become immutable in a future release
|
void |
setRadius(double radius)
Deprecated.
conics will become immutable in a future release
|
String |
toString() |
CircleLine2D |
transform(CircleInversion2D inv)
Transforms the shape by a circle inversion.
|
contains, create, create, create, create, create, fill, getAngle, getBoundaryCurves, getBoundingBox, getCenter, getCurvature, getDomain, getGeneralPath, getProjectedPoint, getProjectedVector, getRho, getSemiMajorAxisLength, getSemiMinorAxisLength, getT0, getT1, getVector1, getVector2, getWindingAngle, isBounded, isClosed, isDirect, isEmpty, project, reduceCentered, setCenter, setCenter, setEllipse, setEllipse, setEllipse, setEllipse, transform, transformCenteredgetLeftTangent, getRightTangent, getSingularPoints, isSingulargetAsAWTShape, getAsPolyline, wrapCurvefinalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetAsPolyline, getLeftTangent, getRightTangent, isClosedgetAsAWTShape, getSingularPoints, getT0, getT1, isSingular, projectcontains, getBoundingBox, isBounded, isEmptytransformgetCurvaturefill, getBoundaryCurves, getDomainpublic Circle2D()
public Circle2D(Point2D center, double radius)
public Circle2D(Point2D center, double radius, boolean direct)
public Circle2D(double xcenter,
double ycenter,
double radius)
public Circle2D(double xcenter,
double ycenter,
double radius,
boolean direct)
public static Circle2D create(Point2D center, double radius)
public static Circle2D create(Point2D p1, Point2D p2, Point2D p3)
public static Collection<Point2D> getIntersections(Circle2D circle1, Circle2D circle2)
public static Collection<Point2D> getIntersections(CircularShape2D circle, LinearShape2D line)
public double getRadius()
@Deprecated public void setRadius(double radius)
@Deprecated public void setCircle(double xc, double yc, double r)
@Deprecated public void setCircle(Point2D center, double r)
public Circle2D getSupportingCircle()
getSupportingCircle in interface CircularShape2Dpublic Conic2D.Type getConicType()
getConicType in interface Conic2DgetConicType in class Ellipse2Dpublic double[] getConicCoefficients()
(x-xc)^2 + (y-yc)^2 = r^2, giving:
x^2 + 0*x*y + y^2 -2*xc*x -2*yc*y + xc*xc+yc*yc-r*r = 0.
getConicCoefficients in interface Conic2DgetConicCoefficients in class Ellipse2Dpublic double getEccentricity()
getEccentricity in interface Conic2DgetEccentricity in class Ellipse2Dpublic Point2D getFocus1()
public Point2D getFocus2()
public CirculinearDomain2D getBuffer(double dist)
CirculinearShape2DgetBuffer in interface CirculinearShape2Ddist - the maximal distance between a point of the buffer and the
shapepublic Circle2D getParallel(double d)
getParallel in interface CircleLine2DgetParallel in interface CirculinearContinuousCurve2DgetParallel in interface CirculinearContour2DgetParallel in interface CirculinearCurve2DgetParallel in interface CirculinearElement2DgetParallel in interface ContinuousCirculinearCurve2DgetParallel in class Ellipse2Dd - the distance between the original curve and he parallel curve.public double getLength()
getLength in interface CirculinearCurve2Dpublic double getLength(double pos)
getLength in interface CirculinearCurve2Dpublic double getPosition(double length)
getPosition in interface CirculinearCurve2Dpublic CircleLine2D transform(CircleInversion2D inv)
CirculinearShape2Dtransform in interface CircleLine2Dtransform in interface CirculinearBoundary2Dtransform in interface CirculinearContinuousCurve2Dtransform in interface CirculinearContour2Dtransform in interface CirculinearCurve2Dtransform in interface CirculinearElement2Dtransform in interface CirculinearShape2Dtransform in interface ContinuousCirculinearCurve2Dinv - the circle inversionpublic Vector2D getTangent(double t)
getTangent in interface SmoothCurve2DgetTangent in class Ellipse2Dpublic Collection<? extends Circle2D> getSmoothPieces()
getSmoothPieces in interface CirculinearContinuousCurve2DgetSmoothPieces in interface ContinuousCirculinearCurve2DgetSmoothPieces in interface ContinuousCurve2DgetSmoothPieces in class AbstractSmoothCurve2Dpublic boolean isInside(Point2D point)
isInside in interface Boundary2DisInside in interface OrientedCurve2DisInside in class Ellipse2Dpoint - a point in the planepublic double getSignedDistance(Point2D point)
OrientedCurve2DgetSignedDistance in interface OrientedCurve2DgetSignedDistance in class Ellipse2Dpoint - a point of the planepublic double getSignedDistance(double x,
double y)
OrientedCurve2DgetSignedDistance in interface OrientedCurve2DgetSignedDistance in class Ellipse2Dx - x-coord of a pointy - y-coord of a pointpublic Point2D getPoint(double t)
public Point2D getFirstPoint()
getFirstPoint in interface Curve2DgetFirstPoint in class Ellipse2Dpublic Point2D getLastPoint()
getLastPoint in interface Curve2DgetLastPoint in class Ellipse2Dpublic double getPosition(Point2D point)
Curve2DgetPosition in interface Curve2DgetPosition in class Ellipse2Dpoint - a point belonging to the curvepublic Circle2D getReverseCurve()
getReverseCurve in interface CircleLine2DgetReverseCurve in interface CirculinearBoundary2DgetReverseCurve in interface CirculinearContinuousCurve2DgetReverseCurve in interface CirculinearContour2DgetReverseCurve in interface CirculinearCurve2DgetReverseCurve in interface CirculinearElement2DgetReverseCurve in interface ContinuousCirculinearCurve2DgetReverseCurve in interface CircularShape2DgetReverseCurve in interface Conic2DgetReverseCurve in interface ContinuousCurve2DgetReverseCurve in interface Curve2DgetReverseCurve in interface SmoothCurve2DgetReverseCurve in interface Boundary2DgetReverseCurve in interface ContinuousBoundary2DgetReverseCurve in interface ContinuousOrientedCurve2DgetReverseCurve in interface OrientedCurve2DgetReverseCurve in interface SmoothBoundary2DgetReverseCurve in interface SmoothOrientedCurve2DgetReverseCurve in class Ellipse2Dpublic CircleArc2D getSubCurve(double t0, double t1)
getSubCurve in interface CirculinearContinuousCurve2DgetSubCurve in interface CirculinearCurve2DgetSubCurve in interface CirculinearElement2DgetSubCurve in interface ContinuousCirculinearCurve2DgetSubCurve in interface CircularShape2DgetSubCurve in interface ContinuousCurve2DgetSubCurve in interface Curve2DgetSubCurve in interface SmoothCurve2DgetSubCurve in interface ContinuousOrientedCurve2DgetSubCurve in interface SmoothOrientedCurve2DgetSubCurve in class Ellipse2Dt0 - position of the start of the sub-curvet1 - position of the end of the sub-curvepublic Collection<? extends Circle2D> getContinuousCurves()
Curve2DgetContinuousCurves in interface CirculinearBoundary2DgetContinuousCurves in interface CirculinearCurve2DgetContinuousCurves in interface Curve2DgetContinuousCurves in class Ellipse2Dpublic double getDistance(Point2D point)
Shape2DgetDistance in interface Shape2DgetDistance in class Ellipse2Dpublic double getDistance(double x,
double y)
Shape2DgetDistance in interface Shape2DgetDistance in class Ellipse2Dpublic Collection<Point2D> getIntersections(LinearShape2D line)
getIntersections in interface Curve2DgetIntersections in class Ellipse2Dpublic CurveSet2D<? extends CircularShape2D> clip(Box2D box)
clip in interface CirculinearBoundary2Dclip in interface CirculinearContinuousCurve2Dclip in interface CirculinearCurve2Dclip in interface CirculinearElement2Dclip in interface ContinuousCirculinearCurve2Dclip in interface CircularShape2Dclip in interface Conic2Dclip in interface ContinuousCurve2Dclip in interface Curve2Dclip in interface SmoothCurve2Dclip in interface ContinuousOrientedCurve2Dclip in interface OrientedCurve2Dclip in interface SmoothOrientedCurve2Dclip in interface Shape2Dclip in class Ellipse2Dbox - the clipping boxpublic boolean contains(double x,
double y)
public GeneralPath appendPath(GeneralPath path)
Ellipse2DappendPath in interface ContinuousCurve2DappendPath in class Ellipse2Dpath - the path to be completedpublic void draw(Graphics2D g2)
Curve2DCopyright © 2012 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.