|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.gicentre.utils.geom.Ellipse
public class Ellipse
Class for representing an ellipse. Unlike Processing's own ellipse command this can represent ellipses with axes aligned at any angle. See also www.spaceroots.org/documents/ellipse for some of the mathematical derivations used in this class.
| Constructor Summary | |
|---|---|
Ellipse(double cx,
double cy,
double eWidth,
double eHeight)
Creates and ellipse with axes aligned to coordinate axes. |
|
Ellipse(double cx,
double cy,
double eWidth,
double eHeight,
double theta)
Creates and ellipse major axis orientated at the given angle. |
|
| Method Summary | |
|---|---|
static double |
clockwiseAngleBetween(double startAngle,
double endAngle)
Calculates the clockwise angle between the given first and second angles. |
processing.core.PVector[] |
getBezier(double startAngle,
double endAngle)
Provides the cubic Bezier anchor (p) and control points (q) that approximate the elliptical arc between the two given angles. |
processing.core.PVector[] |
getBezierVertices(double startAngle,
double endAngle)
Provides a collection of Bezier anchor (p) and control (q) points representing the elliptical arc between the given angles. |
processing.core.PVector |
getCentre()
Reports the centre position of the ellipse. |
processing.core.PVector |
getFocus1()
Reports the first focus of the ellipse. |
processing.core.PVector |
getFocus2()
Reports the second focus of the ellipse. |
double |
getMajor()
Reports the semi-major axis of the ellipse (its longest radius from the centre to circumference). |
double |
getMinor()
Reports the semi-minor axis of the ellipse (its shortest radius from the centre to circumference). |
processing.core.PVector |
getPosition(double lamda)
Reports the elliptical position for any given angle lambda. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Ellipse(double cx,
double cy,
double eWidth,
double eHeight)
cx - x-coordinate of the centre of the ellipse.cy - y-coordinate of the centre of the ellipse.eWidth - Width of the ellipse.eHeight - Height of the ellipse.
public Ellipse(double cx,
double cy,
double eWidth,
double eHeight,
double theta)
cx - x-coordinate of the centre of the ellipse.cy - y-coordinate of the centre of the ellipse.eWidth - Width of the ellipse.eHeight - Height of the ellipse.theta - Orientation of the major axis (in radians).| Method Detail |
|---|
public processing.core.PVector getPosition(double lamda)
lamda - Angle in radians from which elliptical position is to be calculated.
public processing.core.PVector[] getBezier(double startAngle,
double endAngle)
startAngle - First angle in arc (radians).endAngle - Second angle in arc (radians).
public processing.core.PVector[] getBezierVertices(double startAngle,
double endAngle)
getBezier(), this
method can be used to define any arc length from 0 to 2PI radians and should be
visibly accurate.
startAngle - First angle in arc (radians).endAngle - Second angle in arc (radians).
bezierVertex()
methods from between beginShape() and endShape(). Note that when
doing this, the first anchor point (p1) should be fixed with a call to vertex().
public static double clockwiseAngleBetween(double startAngle,
double endAngle)
startAngle - First angle in arc (radians).endAngle - Second angle in arc (radians).
public processing.core.PVector getCentre()
public double getMajor()
public double getMinor()
public processing.core.PVector getFocus1()
public processing.core.PVector getFocus2()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||