|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||

java.lang.Objectmath.geom2d.curve.AbstractContinuousCurve2D
math.geom2d.curve.AbstractSmoothCurve2D
math.geom2d.conic.Ellipse2D
math.geom2d.conic.Circle2D
public class Circle2D
A circle in the plane, defined as the set of points located at an equal distance from the circle center. A circle is a particular ellipse, with first and second axis length equal.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface math.geom2d.conic.Conic2D |
|---|
Conic2D.Type |
| Field Summary | |
|---|---|
protected double |
r
the radius of the circle. |
| Fields inherited from class math.geom2d.conic.Ellipse2D |
|---|
direct, r1, r2, theta, xc, yc |
| Fields inherited from interface math.geom2d.Shape2D |
|---|
ACCURACY |
| Constructor Summary | |
|---|---|
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 |
|
| Method Summary | |
|---|---|
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: (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. |
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. fillable) shape. |
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. t0 and t1 are position on circle. |
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. |
| Methods inherited from class math.geom2d.conic.Ellipse2D |
|---|
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, transformCentered |
| Methods inherited from class math.geom2d.curve.AbstractSmoothCurve2D |
|---|
getLeftTangent, getRightTangent, getSingularPoints, isSingular |
| Methods inherited from class math.geom2d.curve.AbstractContinuousCurve2D |
|---|
getAsAWTShape, getAsPolyline, wrapCurve |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface math.geom2d.curve.ContinuousCurve2D |
|---|
getAsPolyline, getLeftTangent, getRightTangent, isClosed |
| Methods inherited from interface math.geom2d.curve.Curve2D |
|---|
getAsAWTShape, getSingularPoints, getT0, getT1, isSingular, project |
| Methods inherited from interface math.geom2d.Shape2D |
|---|
contains, getBoundingBox, isBounded, isEmpty |
| Methods inherited from interface math.geom2d.domain.SmoothBoundary2D |
|---|
transform |
| Methods inherited from interface math.geom2d.curve.SmoothCurve2D |
|---|
getCurvature |
| Methods inherited from interface math.geom2d.domain.Boundary2D |
|---|
fill, getBoundaryCurves, getDomain |
| Field Detail |
|---|
protected double r
| Constructor Detail |
|---|
public 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)
| Method Detail |
|---|
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 boolean isCircle()
isCircle 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()
getFocus1 in class Ellipse2Dpublic Point2D getFocus2()
getFocus2 in class Ellipse2Dpublic CirculinearDomain2D getBuffer(double dist)
CirculinearShape2D
getBuffer in interface CirculinearShape2Ddist - the maximal distance between a point of the buffer and the
shape
public 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)
CirculinearShape2D
transform 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 inversion
public 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 plane
public double getSignedDistance(Point2D point)
OrientedCurve2D
getSignedDistance in interface OrientedCurve2DgetSignedDistance in class Ellipse2Dpoint - a point of the plane
public double getSignedDistance(double x,
double y)
OrientedCurve2D
getSignedDistance in interface OrientedCurve2DgetSignedDistance in class Ellipse2Dx - x-coord of a pointy - y-coord of a point
public Point2D getPoint(double t)
getPoint in interface Curve2DgetPoint in class Ellipse2Dpublic Point2D getFirstPoint()
getFirstPoint in interface Curve2DgetFirstPoint in class Ellipse2Dpublic Point2D getLastPoint()
getLastPoint in interface Curve2DgetLastPoint in class Ellipse2Dpublic double getPosition(Point2D point)
Curve2D
getPosition in interface Curve2DgetPosition in class Ellipse2Dpoint - a point belonging to the curve
public 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 Ellipse2D
public 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-curve
public Collection<? extends Circle2D> getContinuousCurves()
Curve2D
getContinuousCurves in interface CirculinearBoundary2DgetContinuousCurves in interface CirculinearCurve2DgetContinuousCurves in interface Curve2DgetContinuousCurves in class Ellipse2Dpublic double getDistance(Point2D point)
Shape2D
getDistance in interface Shape2DgetDistance in class Ellipse2D
public double getDistance(double x,
double y)
Shape2D
getDistance 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 box
public boolean contains(double x,
double y)
contains in interface Shape2Dcontains in class Ellipse2Dpublic GeneralPath appendPath(GeneralPath path)
Ellipse2D
appendPath in interface ContinuousCurve2DappendPath in class Ellipse2Dpath - the path to be completed
public void draw(Graphics2D g2)
Curve2D
draw in interface Curve2Ddraw in interface Shape2Ddraw in class Ellipse2Dg2 - the graphics to draw the curvepublic String toString()
toString in class Ellipse2Dpublic boolean equals(Object obj)
equals in class Ellipse2Dpublic Circle2D clone()
Curve2D
clone in interface Curve2Dclone in class Ellipse2D
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||