public static class Ellipses.Circle
extends java.awt.geom.Ellipse2D.Float
Modifier and Type | Field and Description |
---|---|
private java.awt.geom.Point2D.Float |
_center |
private float |
_radius |
Constructor and Description |
---|
Circle(double radius) |
Circle(double centerX,
double centerY,
double radius) |
Circle(java.awt.geom.Point2D center,
double radius) |
Modifier and Type | Method and Description |
---|---|
java.awt.geom.Arc2D |
arc(double startAngle,
double arcAngle) |
static Ellipses.Circle |
calcFromPoints(java.awt.geom.Point2D p1,
java.awt.geom.Point2D p2,
java.awt.geom.Point2D p3)
Calculate the center and radius of a circle from from 3 points on the circle.
|
static Ellipses.Circle |
calcLeastSquaresFit(java.awt.geom.Point2D... points) |
java.awt.geom.Point2D.Float |
center() |
void |
center(double x,
double y) |
void |
center(java.awt.geom.Point2D center) |
double |
getCircleX(double angle)
get the x-coordinate of the circle at the specified angle.
|
double |
getCircleY(double angle)
get the y-coordinate of the circle at the specified angle.
|
java.awt.geom.Point2D |
getPoint(double angle) |
void |
getPoint(double angle,
java.awt.geom.Point2D result) |
static double |
getRadiusFromArcAndChord(double arcLength,
double chordLength)
This calculates the circumference of a circle based on an arc that is cut by a chord.
|
float |
radius() |
void |
radius(double radius) |
void |
setCircle(java.awt.geom.Point2D center,
float radius) |
void |
translate(float dx,
float dy) |
getBounds2D, getHeight, getWidth, getX, getY, isEmpty, setFrame, setFrame
contains, contains, equals, getPathIterator, hashCode, intersects
public Circle(double radius)
public Circle(double centerX, double centerY, double radius)
public Circle(java.awt.geom.Point2D center, double radius)
public java.awt.geom.Arc2D arc(double startAngle, double arcAngle)
public static Ellipses.Circle calcFromPoints(java.awt.geom.Point2D p1, java.awt.geom.Point2D p2, java.awt.geom.Point2D p3)
p1
- A point on the circlep2
- A point on the circlep3
- A point on the circlepublic static Ellipses.Circle calcLeastSquaresFit(java.awt.geom.Point2D... points)
public java.awt.geom.Point2D.Float center()
public void center(double x, double y)
public void center(java.awt.geom.Point2D center)
public double getCircleX(double angle)
public double getCircleY(double angle)
public java.awt.geom.Point2D getPoint(double angle)
public void getPoint(double angle, java.awt.geom.Point2D result)
public static double getRadiusFromArcAndChord(double arcLength, double chordLength)
public float radius()
public void radius(double radius)
public void setCircle(java.awt.geom.Point2D center, float radius)
public void translate(float dx, float dy)