|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectmath.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.
| 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.conic.Conic2D |
|---|
CIRCLE, ELLIPSE, HYPERBOLA, NOT_A_CONIC, PARABOLA, POINT, STRAIGHT_LINE, TWO_LINES |
| Fields inherited from interface math.geom2d.curve.ContinuousCurve2D |
|---|
CLOSED_EDGE, LOOP, OPEN_EDGE |
| Fields inherited from interface math.geom2d.Shape2D |
|---|
ACCURACY, defaultClipWindow, EMPTY_SET |
| 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 and radius |
|
Circle2D(Point2D center,
double radius)
Create a new circle with specified point center and radius |
|
| Method Summary | |
|---|---|
java.awt.geom.GeneralPath |
appendPath(java.awt.geom.GeneralPath path)
Add the path of the ellipse to the given path. |
CurveSet2D<? extends SmoothOrientedCurve2D> |
clip(Box2D box)
Clip the circle by a box. |
boolean |
contains(double x,
double y)
Return true if the point (x, y) lies exactly on the circle. |
boolean |
equals(java.lang.Object obj)
|
java.awt.Rectangle |
getBounds()
Return bounding box of the circle. |
java.awt.geom.Rectangle2D |
getBounds2D()
Return more precise bounds of the circle. |
double[] |
getCartesianEquation()
return 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. |
int |
getConicType()
|
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(java.awt.geom.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, whihc 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. |
protected java.awt.geom.GeneralPath |
getGeneralPath()
|
java.util.Collection<Point2D> |
getIntersections(StraightObject2D 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 |
getLength1()
Returns the length of the first semi-axis of the ellipse. |
double |
getLength2()
Returns the length of the second semi-axis of the ellipse. |
java.awt.geom.PathIterator |
getPathIterator(java.awt.geom.AffineTransform trans)
Return pathiterator for this circle. |
java.awt.geom.PathIterator |
getPathIterator(java.awt.geom.AffineTransform trans,
double flatness)
Return pathiterator for this circle. |
Point2D |
getPoint(double t)
Get the position of the curve from internal parametric representation, depending on the parameter t. |
Point2D |
getPoint(double t,
Point2D point)
Get the position of the curve from internal parametric representation, depending on the parameter t. |
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(java.awt.geom.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. |
CircleArc2D |
getSubCurve(double t0,
double t1)
return a new CircleArc2D. t0 and t1 are position on circle. |
Vector2D |
getTangent(double t)
|
boolean |
isCircle()
|
boolean |
isDegenerated()
|
boolean |
isEllipse()
|
boolean |
isHyperbola()
|
boolean |
isParabola()
|
boolean |
isPoint()
|
boolean |
isStraightLine()
|
boolean |
isTwoLines()
|
void |
setCircle(double xc,
double yc,
double r)
|
void |
setCircle(Point2D center,
double r)
|
void |
setRadius(double radius)
|
| Methods inherited from class math.geom2d.conic.Ellipse2D |
|---|
contains, contains, contains, getAngle, getAsPolyline, getBoundaryCurves, getBoundingBox, getCenter, getContinuousCurves, getCurvature, getProjectedPoint, getProjectedVector, getRho, getSmoothPieces, getT0, getT1, getVector1, getVector2, getWindingAngle, intersects, intersects, isBounded, isClosed, isDirect, isInside, project, setCenter, setCenter, setEllipse, setEllipse, setEllipse, setEllipse, toString, transform |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected double r
| Constructor Detail |
|---|
public Circle2D()
public Circle2D(Point2D center,
double radius)
public Circle2D(double xcenter,
double ycenter,
double radius)
public Circle2D(double xcenter,
double ycenter,
double radius,
boolean direct)
| Method Detail |
|---|
public double getLength()
public double getRadius()
public void setRadius(double radius)
public void setCircle(double xc,
double yc,
double r)
public void setCircle(Point2D center,
double r)
public int getConicType()
getConicType in interface Conic2DgetConicType in class Ellipse2Dpublic boolean isEllipse()
isEllipse in class Ellipse2Dpublic boolean isParabola()
isParabola in class Ellipse2Dpublic boolean isHyperbola()
isHyperbola in class Ellipse2Dpublic boolean isCircle()
isCircle in class Ellipse2Dpublic boolean isStraightLine()
isStraightLine in class Ellipse2Dpublic boolean isTwoLines()
isTwoLines in class Ellipse2Dpublic boolean isPoint()
isPoint in class Ellipse2Dpublic boolean isDegenerated()
isDegenerated in class Ellipse2Dpublic double[] getCartesianEquation()
(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.
getCartesianEquation in interface Conic2DgetCartesianEquation in class Ellipse2Dpublic double getLength1()
getLength1 in class Ellipse2Dpublic double getLength2()
getLength2 in class Ellipse2Dpublic double getEccentricity()
getEccentricity in interface Conic2DgetEccentricity in class Ellipse2Dpublic Point2D getFocus1()
getFocus1 in class Ellipse2Dpublic Point2D getFocus2()
getFocus2 in class Ellipse2Dpublic Vector2D getTangent(double t)
getTangent in interface SmoothCurve2DgetTangent in class Ellipse2Dpublic double getSignedDistance(java.awt.geom.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 Ellipse2D
public Point2D getPoint(double t,
Point2D point)
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 Conic2DgetReverseCurve in interface Boundary2DgetReverseCurve in interface ContinuousBoundary2DgetReverseCurve in interface ContinuousCurve2DgetReverseCurve in interface ContinuousOrientedCurve2DgetReverseCurve in interface Curve2DgetReverseCurve in interface OrientedCurve2DgetReverseCurve in interface SmoothCurve2DgetReverseCurve in interface SmoothOrientedCurve2DgetReverseCurve in class Ellipse2D
public CircleArc2D getSubCurve(double t0,
double t1)
getSubCurve in interface ContinuousCurve2DgetSubCurve in interface ContinuousOrientedCurve2DgetSubCurve in interface Curve2DgetSubCurve in interface SmoothCurve2DgetSubCurve in interface SmoothOrientedCurve2DgetSubCurve in class Ellipse2Dt0 - position of the start of the sub-curvet1 - position of the end of the sub-curve
public double getDistance(java.awt.geom.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 java.util.Collection<Point2D> getIntersections(StraightObject2D line)
getIntersections in interface Curve2DgetIntersections in class Ellipse2Dpublic CurveSet2D<? extends SmoothOrientedCurve2D> clip(Box2D box)
clip in interface Conic2Dclip in interface ContinuousCurve2Dclip in interface ContinuousOrientedCurve2Dclip in interface Curve2Dclip in interface OrientedCurve2Dclip in interface SmoothCurve2Dclip in interface SmoothOrientedCurve2Dclip in interface Shape2Dclip in class Ellipse2Dbox - the clipping box
public boolean contains(double x,
double y)
contains in interface java.awt.Shapecontains in class Ellipse2Dpublic java.awt.Rectangle getBounds()
getBounds in interface java.awt.ShapegetBounds in class Ellipse2Dpublic java.awt.geom.Rectangle2D getBounds2D()
getBounds2D in interface java.awt.ShapegetBounds2D in class Ellipse2Dpublic java.awt.geom.GeneralPath appendPath(java.awt.geom.GeneralPath path)
Ellipse2D
appendPath in interface ContinuousCurve2DappendPath in class Ellipse2Dpath - the path to be completed
protected java.awt.geom.GeneralPath getGeneralPath()
getGeneralPath in class Ellipse2Dpublic java.awt.geom.PathIterator getPathIterator(java.awt.geom.AffineTransform trans)
getPathIterator in interface java.awt.ShapegetPathIterator in class Ellipse2D
public java.awt.geom.PathIterator getPathIterator(java.awt.geom.AffineTransform trans,
double flatness)
getPathIterator in interface java.awt.ShapegetPathIterator in class Ellipse2Dpublic boolean equals(java.lang.Object obj)
equals in class Ellipse2D
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||