|
||||||||||
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.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 colinearpublic static Point2D circumCenter(Point2D p1, Point2D p2, Point2D p3)
ColinearPoints2DException
- if the 3 points are colinearpublic 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 CircularShape2D
public boolean isDirect()
isDirect
in interface EllipseShape2D
public Point2D center()
center
in interface EllipseShape2D
public Vector2D vector1()
public Vector2D vector2()
public double angle()
public Point2D focus1()
public Point2D focus2()
public boolean isCircle()
EllipseShape2D
isCircle
in interface EllipseShape2D
public Ellipse2D asEllipse()
public Conic2D.Type conicType()
conicType
in interface Conic2D
public 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 Conic2D
public double eccentricity()
eccentricity
in interface Conic2D
public CirculinearDomain2D buffer(double dist)
CirculinearShape2D
buffer
in interface CirculinearShape2D
dist
- the maximal distance between a point of the buffer and the
shape
public Circle2D parallel(double d)
parallel
in interface CircleLine2D
parallel
in interface CirculinearBoundary2D
parallel
in interface CirculinearContinuousCurve2D
parallel
in interface CirculinearContour2D
parallel
in interface CirculinearCurve2D
parallel
in interface CirculinearElement2D
parallel
in interface CirculinearRing2D
d
- the distance between the original curve and he parallel curve.
public double length()
length
in interface CirculinearCurve2D
public double length(double pos)
length
in interface CirculinearCurve2D
CirculinearCurve2D.length(double)
public double position(double length)
position
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
inv
- the circle inversion
public CirculinearDomain2D domain()
Boundary2D
domain
in interface CirculinearBoundary2D
domain
in interface CirculinearRing2D
domain
in interface Boundary2D
public void fill(java.awt.Graphics2D g2)
Boundary2D
fill
in interface Boundary2D
g2
- the Graphics to fill onpublic double windingAngle(Point2D point)
windingAngle
in interface OrientedCurve2D
point
- a point of the plane
public Vector2D tangent(double t)
SmoothCurve2D
tangent
in interface SmoothCurve2D
t
- a position on the curve
SmoothCurve2D.normal(double)
public double curvature(double t)
curvature
in interface ContinuousCurve2D
t
- the position on the curve
public java.util.Collection<? extends Circle2D> smoothPieces()
smoothPieces
in interface CirculinearContinuousCurve2D
smoothPieces
in interface ContinuousCurve2D
smoothPieces
in class AbstractSmoothCurve2D
public boolean isClosed()
isClosed
in interface ContinuousCurve2D
public LinearRing2D asPolyline(int n)
AbstractContinuousCurve2D
asPolyline
in interface ContinuousCurve2D
asPolyline
in class AbstractContinuousCurve2D
n
- the number of line segments
n
line segments.ContinuousCurve2D.asPolyline(int)
public boolean isInside(Point2D point)
isInside
in interface Boundary2D
isInside
in interface OrientedCurve2D
point
- a point in the plane
public double signedDistance(Point2D point)
OrientedCurve2D
signedDistance
in interface OrientedCurve2D
point
- a point of the plane
public double signedDistance(double x, double y)
OrientedCurve2D
signedDistance
in interface OrientedCurve2D
x
- x-coord of a pointy
- y-coord of a point
public boolean isBounded()
isBounded
in interface Shape2D
public boolean isEmpty()
isEmpty
in interface Shape2D
public double t0()
t0
in interface Curve2D
@Deprecated public double getT0()
getT0
in interface Curve2D
public double t1()
t1
in interface Curve2D
@Deprecated public double getT1()
getT1
in interface Curve2D
public Point2D point(double t)
point
in interface Curve2D
public Point2D firstPoint()
firstPoint
in interface Curve2D
firstPoint
in class AbstractContinuousCurve2D
Curve2D.t0()
,
Curve2D.point(double)
public Point2D lastPoint()
lastPoint
in interface Curve2D
lastPoint
in class AbstractContinuousCurve2D
Curve2D.t1()
,
Curve2D.point(double)
public double position(Point2D point)
Curve2D
point(double)
method.
position
in interface Curve2D
point
- a point belonging to the curve
Curve2D.point(double)
public double project(Point2D point)
project
in interface Curve2D
point
- a point to project
public Circle2D reverse()
reverse
in interface CircleLine2D
reverse
in interface CirculinearBoundary2D
reverse
in interface CirculinearContinuousCurve2D
reverse
in interface CirculinearContour2D
reverse
in interface CirculinearCurve2D
reverse
in interface CirculinearElement2D
reverse
in interface CirculinearRing2D
reverse
in interface CircularShape2D
reverse
in interface Conic2D
reverse
in interface EllipseShape2D
reverse
in interface ContinuousCurve2D
reverse
in interface Curve2D
reverse
in interface SmoothCurve2D
reverse
in interface Boundary2D
reverse
in interface ContinuousOrientedCurve2D
reverse
in interface Contour2D
reverse
in interface OrientedCurve2D
reverse
in interface SmoothContour2D
reverse
in interface SmoothOrientedCurve2D
public CircleArc2D subCurve(double t0, double t1)
subCurve
in interface CirculinearContinuousCurve2D
subCurve
in interface CirculinearCurve2D
subCurve
in interface CirculinearElement2D
subCurve
in interface CircularShape2D
subCurve
in interface ContinuousCurve2D
subCurve
in interface Curve2D
subCurve
in interface SmoothCurve2D
subCurve
in interface ContinuousOrientedCurve2D
subCurve
in interface SmoothOrientedCurve2D
t0
- 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 CirculinearBoundary2D
continuousCurves
in interface CirculinearCurve2D
continuousCurves
in interface EllipseShape2D
continuousCurves
in interface Curve2D
continuousCurves
in interface Boundary2D
continuousCurves
in class AbstractContinuousCurve2D
public double distance(Point2D point)
Shape2D
distance
in interface Shape2D
public double distance(double x, double y)
Shape2D
distance
in interface Shape2D
public java.util.Collection<Point2D> intersections(LinearShape2D line)
intersections
in interface Curve2D
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 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
box
- the clipping box
public boolean contains(Point2D p)
contains
in interface Shape2D
public boolean contains(double x, double y)
contains
in interface Shape2D
public java.awt.geom.GeneralPath appendPath(java.awt.geom.GeneralPath path)
ContinuousCurve2D
appendPath
in interface ContinuousCurve2D
path
- a path to modify
public void draw(java.awt.Graphics2D g2)
Curve2D
draw
in interface Curve2D
draw
in interface Shape2D
draw
in class AbstractContinuousCurve2D
g2
- the graphics to draw the curve inpublic boolean almostEquals(GeometricObject2D obj, double eps)
GeometricObject2D
almostEquals
in interface GeometricObject2D
obj
- the object to compareeps
- a threshold value, for example the minimal coordinate difference
public Box2D boundingBox()
boundingBox
in interface Shape2D
public EllipseShape2D transform(AffineTransform2D trans)
transform
in interface Conic2D
transform
in interface EllipseShape2D
transform
in interface ContinuousCurve2D
transform
in interface Curve2D
transform
in interface SmoothCurve2D
transform
in interface Boundary2D
transform
in interface ContinuousOrientedCurve2D
transform
in interface Contour2D
transform
in interface OrientedCurve2D
transform
in interface SmoothContour2D
transform
in interface SmoothOrientedCurve2D
transform
in interface Shape2D
trans
- an affine transform
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public Circle2D clone()
Curve2D
clone
in interface Curve2D
clone
in class AbstractSmoothCurve2D
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |