|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object math.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: |
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. |
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 CircularShape2D
public Conic2D.Type getConicType()
getConicType
in interface Conic2D
getConicType
in class Ellipse2D
public boolean isCircle()
isCircle
in class Ellipse2D
public 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 Conic2D
getConicCoefficients
in class Ellipse2D
public double getEccentricity()
getEccentricity
in interface Conic2D
getEccentricity
in class Ellipse2D
public Point2D getFocus1()
getFocus1
in class Ellipse2D
public Point2D getFocus2()
getFocus2
in class Ellipse2D
public CirculinearDomain2D getBuffer(double dist)
CirculinearShape2D
getBuffer
in interface CirculinearShape2D
dist
- the maximal distance between a point of the buffer and the
shape
public Circle2D getParallel(double d)
getParallel
in interface CircleLine2D
getParallel
in interface CirculinearContinuousCurve2D
getParallel
in interface CirculinearContour2D
getParallel
in interface CirculinearCurve2D
getParallel
in interface CirculinearElement2D
getParallel
in interface ContinuousCirculinearCurve2D
getParallel
in class Ellipse2D
d
- the distance between the original curve and he parallel curve.
public double getLength()
getLength
in interface CirculinearCurve2D
public double getLength(double pos)
getLength
in interface CirculinearCurve2D
public double getPosition(double length)
getPosition
in interface CirculinearCurve2D
public CircleLine2D transform(CircleInversion2D inv)
CirculinearShape2D
transform
in interface CircleLine2D
transform
in interface CirculinearBoundary2D
transform
in interface CirculinearContinuousCurve2D
transform
in interface CirculinearContour2D
transform
in interface CirculinearCurve2D
transform
in interface CirculinearElement2D
transform
in interface CirculinearShape2D
transform
in interface ContinuousCirculinearCurve2D
inv
- the circle inversion
public Vector2D getTangent(double t)
getTangent
in interface SmoothCurve2D
getTangent
in class Ellipse2D
public Collection<? extends Circle2D> getSmoothPieces()
getSmoothPieces
in interface CirculinearContinuousCurve2D
getSmoothPieces
in interface ContinuousCirculinearCurve2D
getSmoothPieces
in interface ContinuousCurve2D
getSmoothPieces
in class AbstractSmoothCurve2D
public boolean isInside(Point2D point)
isInside
in interface Boundary2D
isInside
in interface OrientedCurve2D
isInside
in class Ellipse2D
point
- a point in the plane
public double getSignedDistance(Point2D point)
OrientedCurve2D
getSignedDistance
in interface OrientedCurve2D
getSignedDistance
in class Ellipse2D
point
- a point of the plane
public double getSignedDistance(double x, double y)
OrientedCurve2D
getSignedDistance
in interface OrientedCurve2D
getSignedDistance
in class Ellipse2D
x
- x-coord of a pointy
- y-coord of a point
public Point2D getPoint(double t)
getPoint
in interface Curve2D
getPoint
in class Ellipse2D
public Point2D getFirstPoint()
getFirstPoint
in interface Curve2D
getFirstPoint
in class Ellipse2D
public Point2D getLastPoint()
getLastPoint
in interface Curve2D
getLastPoint
in class Ellipse2D
public double getPosition(Point2D point)
Curve2D
getPosition
in interface Curve2D
getPosition
in class Ellipse2D
point
- a point belonging to the curve
public Circle2D getReverseCurve()
getReverseCurve
in interface CircleLine2D
getReverseCurve
in interface CirculinearBoundary2D
getReverseCurve
in interface CirculinearContinuousCurve2D
getReverseCurve
in interface CirculinearContour2D
getReverseCurve
in interface CirculinearCurve2D
getReverseCurve
in interface CirculinearElement2D
getReverseCurve
in interface ContinuousCirculinearCurve2D
getReverseCurve
in interface CircularShape2D
getReverseCurve
in interface Conic2D
getReverseCurve
in interface ContinuousCurve2D
getReverseCurve
in interface Curve2D
getReverseCurve
in interface SmoothCurve2D
getReverseCurve
in interface Boundary2D
getReverseCurve
in interface ContinuousBoundary2D
getReverseCurve
in interface ContinuousOrientedCurve2D
getReverseCurve
in interface OrientedCurve2D
getReverseCurve
in interface SmoothBoundary2D
getReverseCurve
in interface SmoothOrientedCurve2D
getReverseCurve
in class Ellipse2D
public CircleArc2D getSubCurve(double t0, double t1)
getSubCurve
in interface CirculinearContinuousCurve2D
getSubCurve
in interface CirculinearCurve2D
getSubCurve
in interface CirculinearElement2D
getSubCurve
in interface ContinuousCirculinearCurve2D
getSubCurve
in interface CircularShape2D
getSubCurve
in interface ContinuousCurve2D
getSubCurve
in interface Curve2D
getSubCurve
in interface SmoothCurve2D
getSubCurve
in interface ContinuousOrientedCurve2D
getSubCurve
in interface SmoothOrientedCurve2D
getSubCurve
in class Ellipse2D
t0
- 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 CirculinearBoundary2D
getContinuousCurves
in interface CirculinearCurve2D
getContinuousCurves
in interface Curve2D
getContinuousCurves
in class Ellipse2D
public double getDistance(Point2D point)
Shape2D
getDistance
in interface Shape2D
getDistance
in class Ellipse2D
public double getDistance(double x, double y)
Shape2D
getDistance
in interface Shape2D
getDistance
in class Ellipse2D
public Collection<Point2D> getIntersections(LinearShape2D line)
getIntersections
in interface Curve2D
getIntersections
in class Ellipse2D
public CurveSet2D<? extends CircularShape2D> clip(Box2D box)
clip
in interface CirculinearBoundary2D
clip
in interface CirculinearContinuousCurve2D
clip
in interface CirculinearCurve2D
clip
in interface CirculinearElement2D
clip
in interface ContinuousCirculinearCurve2D
clip
in interface CircularShape2D
clip
in interface Conic2D
clip
in interface ContinuousCurve2D
clip
in interface Curve2D
clip
in interface SmoothCurve2D
clip
in interface ContinuousOrientedCurve2D
clip
in interface OrientedCurve2D
clip
in interface SmoothOrientedCurve2D
clip
in interface Shape2D
clip
in class Ellipse2D
box
- the clipping box
public boolean contains(double x, double y)
contains
in interface Shape2D
contains
in class Ellipse2D
public GeneralPath appendPath(GeneralPath path)
Ellipse2D
appendPath
in interface ContinuousCurve2D
appendPath
in class Ellipse2D
path
- the path to be completed
public void draw(Graphics2D g2)
Curve2D
draw
in interface Curve2D
draw
in interface Shape2D
draw
in class Ellipse2D
g2
- the graphics to draw the curvepublic String toString()
toString
in class Ellipse2D
public boolean equals(Object obj)
equals
in class Ellipse2D
public Circle2D clone()
Curve2D
clone
in interface Curve2D
clone
in class Ellipse2D
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |