|
||||||||||
| 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.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 |
| 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 | |
|---|---|
boolean |
almostEquals(GeometricObject2D obj,
double eps)
Checks if the two objects are similar up to a given threshold value. |
double |
angle()
Returns the angle of the circle main axis with the Ox axis. |
java.awt.geom.GeneralPath |
appendPath(java.awt.geom.GeneralPath path)
Append the path of the curve to the given path. |
Ellipse2D |
asEllipse()
Converts this circle to an instance of Ellipse2D. |
LinearRing2D |
asPolyline(int n)
Converts this continuous curve to an instance of LinearCurve2D with the given number of edges. |
Box2D |
boundingBox()
Returns bounding box of the circle. |
CirculinearDomain2D |
buffer(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. |
Point2D |
center()
Returns center of the circle. |
static java.util.Collection<Point2D> |
circlesIntersections(Circle2D circle1,
Circle2D circle2)
Computes the intersections points between two circles or circular shapes. |
static Point2D |
circumCenter(Point2D p1,
Point2D p2,
Point2D p3)
Computes the center of the circumscribed circle of the three input points. |
static Circle2D |
circumCircle(Point2D p1,
Point2D p2,
Point2D p3)
Computes the circumscribed circle of the 3 input points. |
CurveSet2D<? extends CircularShape2D> |
clip(Box2D box)
Clips the circle by a box. |
Circle2D |
clone()
Overrides Object declaration to ensure Curve2D implementation are cloned as Curve2D. |
double[] |
conicCoefficients()
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 |
conicType()
|
boolean |
contains(double x,
double y)
Returns true if the point (x, y) lies exactly on the circle. |
boolean |
contains(Point2D p)
Returns true if the point p lies on the ellipse, with precision given by Shape2D.ACCURACY. |
java.util.Collection<? extends Circle2D> |
continuousCurves()
Returns the collection of continuous curves which constitute this curve. |
static Circle2D |
create(Point2D center,
double radius)
Deprecated. since 0.11.1 |
static Circle2D |
create(Point2D center,
double radius,
boolean direct)
Deprecated. since 0.11.1 |
static Circle2D |
create(Point2D p1,
Point2D p2,
Point2D p3)
Deprecated. replaced by createCircle(Point2D, Point2D, Point2D) (0.11.1) |
double |
curvature(double t)
Returns the inverse of the circle radius. |
double |
distance(double x,
double y)
Returns 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 |
distance(Point2D point)
Returns 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. |
CirculinearDomain2D |
domain()
Returns the domain delimited by this boundary. |
void |
draw(java.awt.Graphics2D g2)
Draws the curve on the given Graphics2D object. |
double |
eccentricity()
Returns 0, which is the eccentricity of a circle by definition. |
boolean |
equals(java.lang.Object obj)
|
void |
fill(java.awt.Graphics2D g2)
Fills the interior of the boundary, using the Graphics current Paint. |
Point2D |
firstPoint()
Get the first point of the circle, which is the same as the last point. |
Point2D |
focus1()
Returns the first focus, which for a circle is the same point as the center. |
Point2D |
focus2()
Returns the second focus, which for a circle is the same point as the center. |
static java.util.Collection<Point2D> |
getIntersections(Circle2D circle1,
Circle2D circle2)
Deprecated. replaced by circlesIntersections(Circle2D, Circle2D) (0.11.1) |
static java.util.Collection<Point2D> |
getIntersections(CircularShape2D circle,
LinearShape2D line)
Deprecated. replaced by lineCircleIntersections(LinearShape2D, CircularShape2D) (0.11.1) |
double |
getT0()
Deprecated. replaced by t0() (since 0.11.1). |
double |
getT1()
Deprecated. replaced by t1() (since 0.11.1). |
java.util.Collection<Point2D> |
intersections(Circle2D circle)
Returns the intersection points with another circle. |
java.util.Collection<Point2D> |
intersections(LinearShape2D line)
Computes intersections of the circle with a line. |
boolean |
isBounded()
Always returns true. |
boolean |
isCircle()
Returns true if this ellipse shape is similar to a circle, i.e. has same length for both semi-axes. |
boolean |
isClosed()
Returns true, as an ellipse is always closed. |
boolean |
isDirect()
Returns true if circle has a direct orientation. |
boolean |
isEmpty()
Always returns false. |
boolean |
isInside(Point2D point)
Test whether the point is inside the circle. |
Point2D |
lastPoint()
Get the last point of the circle, which is the same as the first point. |
double |
length()
Returns perimeter of the circle (equal to 2*PI*radius). |
double |
length(double pos)
Returns the geodesic leangth until the given position. |
static java.util.Collection<Point2D> |
lineCircleIntersections(LinearShape2D line,
CircularShape2D circle)
Computes intersections of a circle with a line. |
Circle2D |
parallel(double d)
Returns the parallel circle located at a distance d from this circle. |
Point2D |
point(double t)
Get the position of the curve from internal parametric representation, depending on the parameter t. |
double |
position(double length)
|
double |
position(Point2D point)
Computes the position of the point on the curve. |
double |
project(Point2D point)
Computes the projection position of the point on the circle, by computing angle with horizonrtal |
static StraightLine2D |
radicalAxis(Circle2D circle1,
Circle2D circle2)
Computes the radical axis of the two circles. |
double |
radius()
Returns the radius of the circle. |
Circle2D |
reverse()
Returns the circle with same center and same radius, but with the opposite orientation. |
double |
signedDistance(double x,
double y)
The same as distanceSigned(Point2D), but by passing 2 double as arguments. |
double |
signedDistance(Point2D point)
Returns the signed distance of the curve to the given point. |
java.util.Collection<? extends Circle2D> |
smoothPieces()
Returns a set of smooth curves, which contains only the circle. |
CircleArc2D |
subCurve(double t0,
double t1)
Returns a new CircleArc2D. t0 and t1 are position on circle. |
Circle2D |
supportingCircle()
Returns the circle itself. |
double |
t0()
Returns the parameter of the first point of the ellipse, set to 0. |
double |
t1()
Returns the parameter of the last point of the ellipse, set to 2*PI. |
Vector2D |
tangent(double t)
Returns the tangent of the curve at the given position. |
java.lang.String |
toString()
|
EllipseShape2D |
transform(AffineTransform2D trans)
Transforms this circle by an affine transform. |
CircleLine2D |
transform(CircleInversion2D inv)
Transforms the shape by a circle inversion. |
Vector2D |
vector1()
Returns the first direction vector of the circle, in the direction of the major axis. |
Vector2D |
vector2()
Returns the second direction vector of the circle, in the direction of the minor axis. |
double |
windingAngle(Point2D point)
Return either 0, 2*PI or -2*PI, depending whether the point is located inside the interior of the ellipse or not. |
| Methods inherited from class math.geom2d.curve.AbstractSmoothCurve2D |
|---|
isSingular, leftTangent, normal, rightTangent, singularPoints, vertices |
| Methods inherited from class math.geom2d.curve.AbstractContinuousCurve2D |
|---|
asAwtShape |
| Methods inherited from class java.lang.Object |
|---|
getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface math.geom2d.curve.SmoothCurve2D |
|---|
normal |
| Methods inherited from interface math.geom2d.curve.ContinuousCurve2D |
|---|
leftTangent, rightTangent |
| 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 |
|---|
@Deprecated
public static Circle2D create(Point2D center,
double radius)
@Deprecated
public static Circle2D create(Point2D center,
double radius,
boolean direct)
@Deprecated
public static Circle2D create(Point2D p1,
Point2D p2,
Point2D p3)
@Deprecated
public static java.util.Collection<Point2D> getIntersections(Circle2D circle1,
Circle2D circle2)
@Deprecated
public static java.util.Collection<Point2D> getIntersections(CircularShape2D circle,
LinearShape2D line)
public static Circle2D circumCircle(Point2D p1,
Point2D p2,
Point2D p3)
ColinearPoints2DException - if the 3 points are colinear
public static Point2D circumCenter(Point2D p1,
Point2D p2,
Point2D p3)
ColinearPoints2DException - if the 3 points are colinear
public static java.util.Collection<Point2D> circlesIntersections(Circle2D circle1,
Circle2D circle2)
circle1 - an instance of circle or circle arccircle2 - an instance of circle or circle arc
public static java.util.Collection<Point2D> lineCircleIntersections(LinearShape2D line,
CircularShape2D circle)
public static StraightLine2D radicalAxis(Circle2D circle1,
Circle2D circle2)
java.lang.IllegalArgumentException - if the two circles have same centerpublic double radius()
public java.util.Collection<Point2D> intersections(Circle2D circle)
public Circle2D supportingCircle()
supportingCircle in interface CircularShape2Dpublic boolean isDirect()
isDirect in interface EllipseShape2Dpublic Point2D center()
center in interface EllipseShape2Dpublic Vector2D vector1()
public Vector2D vector2()
public double angle()
public Point2D focus1()
public Point2D focus2()
public boolean isCircle()
EllipseShape2D
isCircle in interface EllipseShape2Dpublic Ellipse2D asEllipse()
public Conic2D.Type conicType()
conicType in interface Conic2Dpublic double[] conicCoefficients()
(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.
conicCoefficients in interface Conic2Dpublic double eccentricity()
eccentricity in interface Conic2Dpublic CirculinearDomain2D buffer(double dist)
CirculinearShape2D
buffer in interface CirculinearShape2Ddist - the maximal distance between a point of the buffer and the
shape
public Circle2D parallel(double d)
parallel in interface CircleLine2Dparallel in interface CirculinearBoundary2Dparallel in interface CirculinearContinuousCurve2Dparallel in interface CirculinearContour2Dparallel in interface CirculinearCurve2Dparallel in interface CirculinearElement2Dparallel in interface CirculinearRing2Dd - the distance between the original curve and he parallel curve.
public double length()
length in interface CirculinearCurve2Dpublic double length(double pos)
length in interface CirculinearCurve2DCirculinearCurve2D.length(double)public double position(double length)
position 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 CirculinearShape2Dinv - the circle inversion
public CirculinearDomain2D domain()
Boundary2D
domain in interface CirculinearBoundary2Ddomain in interface CirculinearRing2Ddomain in interface Boundary2Dpublic void fill(java.awt.Graphics2D g2)
Boundary2D
fill in interface Boundary2Dg2 - the Graphics to fill onpublic double windingAngle(Point2D point)
windingAngle in interface OrientedCurve2Dpoint - a point of the plane
public Vector2D tangent(double t)
SmoothCurve2D
tangent in interface SmoothCurve2Dt - a position on the curve
SmoothCurve2D.normal(double)public double curvature(double t)
curvature in interface ContinuousCurve2Dt - the position on the curve
public java.util.Collection<? extends Circle2D> smoothPieces()
smoothPieces in interface CirculinearContinuousCurve2DsmoothPieces in interface ContinuousCurve2DsmoothPieces in class AbstractSmoothCurve2Dpublic boolean isClosed()
isClosed in interface ContinuousCurve2Dpublic LinearRing2D asPolyline(int n)
AbstractContinuousCurve2D
asPolyline in interface ContinuousCurve2DasPolyline in class AbstractContinuousCurve2Dn - the number of line segments
n line segments.ContinuousCurve2D.asPolyline(int)public boolean isInside(Point2D point)
isInside in interface Boundary2DisInside in interface OrientedCurve2Dpoint - a point in the plane
public double signedDistance(Point2D point)
OrientedCurve2D
signedDistance in interface OrientedCurve2Dpoint - a point of the plane
public double signedDistance(double x,
double y)
OrientedCurve2D
signedDistance in interface OrientedCurve2Dx - x-coord of a pointy - y-coord of a point
public boolean isBounded()
isBounded in interface Shape2Dpublic boolean isEmpty()
isEmpty in interface Shape2Dpublic double t0()
t0 in interface Curve2D@Deprecated public double getT0()
getT0 in interface Curve2Dpublic double t1()
t1 in interface Curve2D@Deprecated public double getT1()
getT1 in interface Curve2Dpublic Point2D point(double t)
point in interface Curve2Dpublic Point2D firstPoint()
firstPoint in interface Curve2DfirstPoint in class AbstractContinuousCurve2DCurve2D.t0(),
Curve2D.point(double)public Point2D lastPoint()
lastPoint in interface Curve2DlastPoint in class AbstractContinuousCurve2DCurve2D.t1(),
Curve2D.point(double)public double position(Point2D point)
Curve2Dpoint(double) method.
position in interface Curve2Dpoint - a point belonging to the curve
Curve2D.point(double)public double project(Point2D point)
project in interface Curve2Dpoint - a point to project
public Circle2D reverse()
reverse in interface CircleLine2Dreverse in interface CirculinearBoundary2Dreverse in interface CirculinearContinuousCurve2Dreverse in interface CirculinearContour2Dreverse in interface CirculinearCurve2Dreverse in interface CirculinearElement2Dreverse in interface CirculinearRing2Dreverse in interface CircularShape2Dreverse in interface Conic2Dreverse in interface EllipseShape2Dreverse in interface ContinuousCurve2Dreverse in interface Curve2Dreverse in interface SmoothCurve2Dreverse in interface Boundary2Dreverse in interface ContinuousOrientedCurve2Dreverse in interface Contour2Dreverse in interface OrientedCurve2Dreverse in interface SmoothContour2Dreverse in interface SmoothOrientedCurve2D
public CircleArc2D subCurve(double t0,
double t1)
subCurve in interface CirculinearContinuousCurve2DsubCurve in interface CirculinearCurve2DsubCurve in interface CirculinearElement2DsubCurve in interface CircularShape2DsubCurve in interface ContinuousCurve2DsubCurve in interface Curve2DsubCurve in interface SmoothCurve2DsubCurve in interface ContinuousOrientedCurve2DsubCurve in interface SmoothOrientedCurve2Dt0 - position of the start of the sub-curvet1 - position of the end of the sub-curve
public java.util.Collection<? extends Circle2D> continuousCurves()
Curve2D
continuousCurves in interface CirculinearBoundary2DcontinuousCurves in interface CirculinearCurve2DcontinuousCurves in interface EllipseShape2DcontinuousCurves in interface Curve2DcontinuousCurves in interface Boundary2DcontinuousCurves in class AbstractContinuousCurve2Dpublic double distance(Point2D point)
Shape2D
distance in interface Shape2D
public double distance(double x,
double y)
Shape2D
distance in interface Shape2Dpublic java.util.Collection<Point2D> intersections(LinearShape2D line)
intersections in interface Curve2Dpublic CurveSet2D<? extends CircularShape2D> clip(Box2D box)
clip in interface CirculinearBoundary2Dclip in interface CirculinearContinuousCurve2Dclip in interface CirculinearCurve2Dclip in interface CirculinearElement2Dclip 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 Shape2Dbox - the clipping box
public boolean contains(Point2D p)
contains in interface Shape2D
public boolean contains(double x,
double y)
contains in interface Shape2Dpublic java.awt.geom.GeneralPath appendPath(java.awt.geom.GeneralPath path)
ContinuousCurve2D
appendPath in interface ContinuousCurve2Dpath - a path to modify
public void draw(java.awt.Graphics2D g2)
Curve2D
draw in interface Curve2Ddraw in interface Shape2Ddraw in class AbstractContinuousCurve2Dg2 - the graphics to draw the curve in
public boolean almostEquals(GeometricObject2D obj,
double eps)
GeometricObject2D
almostEquals in interface GeometricObject2Dobj - the object to compareeps - a threshold value, for example the minimal coordinate difference
public Box2D boundingBox()
boundingBox in interface Shape2Dpublic EllipseShape2D transform(AffineTransform2D trans)
transform in interface Conic2Dtransform in interface EllipseShape2Dtransform in interface ContinuousCurve2Dtransform in interface Curve2Dtransform in interface SmoothCurve2Dtransform in interface Boundary2Dtransform in interface ContinuousOrientedCurve2Dtransform in interface Contour2Dtransform in interface OrientedCurve2Dtransform in interface SmoothContour2Dtransform in interface SmoothOrientedCurve2Dtransform in interface Shape2Dtrans - an affine transform
public java.lang.String toString()
toString in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic Circle2D clone()
Curve2D
clone in interface Curve2Dclone in class AbstractSmoothCurve2D
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||