public class Ellipses
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
Ellipses.Circle |
Modifier and Type | Field and Description |
---|---|
static double |
toScreenDegrees |
Constructor and Description |
---|
Ellipses() |
Modifier and Type | Method and Description |
---|---|
static java.awt.geom.Arc2D.Double |
arc(java.awt.geom.Point2D center,
double radius,
double startAngle,
double endAngle,
boolean reversed,
int arcType)
The normal Arc2D constructor expects the angles in degrees.
|
static java.awt.geom.Arc2D.Double |
arc(java.awt.geom.Point2D center,
double radius,
double startAngle,
double arcAngle,
int arcType) |
static double |
calcArcExtent(double startAngle,
double endAngle,
boolean reversed) |
static java.awt.geom.Ellipse2D.Double |
fromCenter(double x,
double y,
double radius) |
static java.awt.geom.Ellipse2D.Double |
fromCenter(double x,
double y,
double w,
double h) |
static java.awt.geom.Ellipse2D.Double |
fromCenter(java.awt.geom.Point2D p,
double radius) |
static java.awt.geom.Ellipse2D.Double |
fromCenter(java.awt.geom.Point2D p,
double w,
double h) |
static java.awt.geom.Ellipse2D.Double |
fromCenter(Vec2D p,
double radius) |
static java.awt.geom.Ellipse2D.Double |
fromCenter(Vec2D p,
double w,
double h) |
static java.awt.geom.Ellipse2D.Double |
fromRect(java.awt.geom.Rectangle2D rc) |
public static final double toScreenDegrees
public static java.awt.geom.Arc2D.Double arc(java.awt.geom.Point2D center, double radius, double startAngle, double endAngle, boolean reversed, int arcType)
center
- the center of the arc's circleradius
- the radius of the arc's circlestartAngle
- the starting angle in radians. This will be multiplied by toScreenDegrees
to account for the upside-down screen coordinates and convert from radians to degrees.endAngle
- the end angle in radians. This will be multiplied by toScreenDegrees
to account for the upside-down screen coordinates and convert from radians to degrees.reversed
- The direction in which the arc should be drawn clockwise(reversed=true) or counter-clockwise(reversed=false).arcType
- The type of arc to draw: Arc2D.CHORD
, Arc2D.PIE
, or Arc2D.OPEN
public static java.awt.geom.Arc2D.Double arc(java.awt.geom.Point2D center, double radius, double startAngle, double arcAngle, int arcType)
public static double calcArcExtent(double startAngle, double endAngle, boolean reversed)
public static java.awt.geom.Ellipse2D.Double fromCenter(double x, double y, double radius)
public static java.awt.geom.Ellipse2D.Double fromCenter(double x, double y, double w, double h)
public static java.awt.geom.Ellipse2D.Double fromCenter(java.awt.geom.Point2D p, double radius)
public static java.awt.geom.Ellipse2D.Double fromCenter(java.awt.geom.Point2D p, double w, double h)
public static java.awt.geom.Ellipse2D.Double fromCenter(Vec2D p, double radius)
public static java.awt.geom.Ellipse2D.Double fromCenter(Vec2D p, double w, double h)
public static java.awt.geom.Ellipse2D.Double fromRect(java.awt.geom.Rectangle2D rc)