|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object math.geom2d.curve.CurveArray2D<T> math.geom2d.domain.ContourArray2D<HyperbolaBranch2D> math.geom2d.conic.Hyperbola2D
public class Hyperbola2D
An Hyperbola, which is represented as a curve set of two boundary curves which are instances of HyperbolaBranch2D.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface math.geom2d.conic.Conic2D |
---|
Conic2D.Type |
Field Summary |
---|
Fields inherited from interface math.geom2d.Shape2D |
---|
ACCURACY |
Constructor Summary | |
---|---|
Hyperbola2D()
Assume centered hyperbola, with a = b = 1 (orthogonal hyperbola), theta=0 (hyperbola is oriented East-West), and direct orientation. |
|
Hyperbola2D(double xc,
double yc,
double a,
double b,
double theta)
|
|
Hyperbola2D(double xc,
double yc,
double a,
double b,
double theta,
boolean d)
Main constructor |
|
Hyperbola2D(Point2D center,
double a,
double b,
double theta)
|
|
Hyperbola2D(Point2D center,
double a,
double b,
double theta,
boolean d)
|
Method Summary | |
---|---|
boolean |
almostEquals(GeometricObject2D obj,
double eps)
Checks if the two objects are similar up to a given threshold value. |
java.util.Collection<StraightLine2D> |
asymptotes()
Returns the asymptotes of the hyperbola. |
Box2D |
boundingBox()
Returns a bounding box with infinite bounds in every direction |
java.util.Collection<HyperbolaBranch2D> |
branches()
|
Hyperbola2D |
clone()
Overrides Object declaration to ensure Curve2D implementation are cloned as Curve2D. |
double[] |
conicCoefficients()
Returns the coefficient of the Cartesian representation of the conic. |
Conic2D.Type |
conicType()
|
boolean |
contains(double x,
double y)
Returns true if one of the curves contains the point |
boolean |
contains(Point2D point)
Returns true if one of the curves contains the point |
static Hyperbola2D |
create(Point2D center,
double a,
double b,
double theta)
|
static Hyperbola2D |
create(Point2D center,
double a,
double b,
double theta,
boolean d)
|
void |
draw(java.awt.Graphics2D g)
Throws an UnboundedShapeException |
double |
eccentricity()
Returns the eccentricity of the conic. |
boolean |
equals(java.lang.Object obj)
Tests whether this hyperbola equals another object. |
double |
getAngle()
Returns the angle made by the first direction vector with the horizontal axis. |
Point2D |
getCenter()
Returns the center of the Hyperbola. |
Point2D |
getFocus1()
Returns the focus located on the positive side of the main hyperbola axis. |
Point2D |
getFocus2()
Returns the focus located on the negative side of the main hyperbola axis. |
double |
getLength1()
Returns a |
double |
getLength2()
Returns b |
Vector2D |
getVector1()
|
Vector2D |
getVector2()
|
java.util.Collection<Point2D> |
intersections(LinearShape2D line)
Returns the intersection points of the curve with the specified line. |
boolean |
isDirect()
|
HyperbolaBranch2D |
negativeBranch()
|
HyperbolaBranch2D |
positiveBranch()
|
static Hyperbola2D |
reduceCentered(double[] coefs)
Creates a new Hyperbola by reducing the conic coefficients, assuming conic type is Hyperbola, and hyperbola is centered. |
Hyperbola2D |
reverse()
Returns the curve with same trace on the plane with parameterization in reverse order. |
Point2D |
toGlobal(Point2D point)
Transforms a point in local coordinate (ie orthogonal centered hyberbola with a=b=1) to global coordinate system. |
Point2D |
toLocal(Point2D point)
|
Hyperbola2D |
transform(AffineTransform2D trans)
Transforms this Hyperbola by an affine transform. |
static Hyperbola2D |
transformCentered(Hyperbola2D hyper,
AffineTransform2D trans)
Transforms an hyperbola, by supposing both the hyperbola is centered and the transform has no translation part. |
Methods inherited from class math.geom2d.domain.ContourArray2D |
---|
clip, continuousCurves, create, create, domain, fill, isInside, signedDistance, signedDistance, subCurve, windingAngle |
Methods inherited from class math.geom2d.curve.CurveArray2D |
---|
add, add, asAwtShape, childCurve, clear, contains, curveIndex, curves, distance, distance, firstCurve, firstPoint, get, getGeneralPath, getT0, getT1, globalPosition, indexOf, isBounded, isEmpty, isSingular, iterator, lastCurve, lastPoint, localPosition, point, position, project, remove, remove, singularPoints, size, t0, t1, vertices |
Methods inherited from class java.lang.Object |
---|
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface math.geom2d.conic.Conic2D |
---|
clip |
Methods inherited from interface math.geom2d.domain.Boundary2D |
---|
continuousCurves, domain, fill, isInside |
Methods inherited from interface math.geom2d.domain.OrientedCurve2D |
---|
signedDistance, signedDistance, windingAngle |
Methods inherited from interface math.geom2d.curve.Curve2D |
---|
asAwtShape, firstPoint, getT0, getT1, isSingular, lastPoint, point, position, project, singularPoints, subCurve, t0, t1, vertices |
Methods inherited from interface math.geom2d.Shape2D |
---|
distance, distance, isBounded, isEmpty |
Constructor Detail |
---|
public Hyperbola2D()
public Hyperbola2D(Point2D center, double a, double b, double theta)
public Hyperbola2D(Point2D center, double a, double b, double theta, boolean d)
public Hyperbola2D(double xc, double yc, double a, double b, double theta)
public Hyperbola2D(double xc, double yc, double a, double b, double theta, boolean d)
Method Detail |
---|
public static Hyperbola2D create(Point2D center, double a, double b, double theta)
public static Hyperbola2D create(Point2D center, double a, double b, double theta, boolean d)
public static Hyperbola2D reduceCentered(double[] coefs)
coefs
- an array of double with at least 3 coefficients containing
coefficients for x^2, xy, and y^2 factors. If the array is
longer, remaining coefficients are ignored.
public static Hyperbola2D transformCentered(Hyperbola2D hyper, AffineTransform2D trans)
hyper
- an hyperbolatrans
- an affine transform
public Point2D toGlobal(Point2D point)
public Point2D toLocal(Point2D point)
public Point2D getCenter()
public double getAngle()
public double getLength1()
public double getLength2()
public boolean isDirect()
public Vector2D getVector1()
public Vector2D getVector2()
public Point2D getFocus1()
public Point2D getFocus2()
public HyperbolaBranch2D positiveBranch()
public HyperbolaBranch2D negativeBranch()
public java.util.Collection<HyperbolaBranch2D> branches()
public java.util.Collection<StraightLine2D> asymptotes()
public double[] conicCoefficients()
Conic2D
a*x^2 + b*x*y + c*y^2 + d*x + e*y + f
The length of the array is then of size 6.
conicCoefficients
in interface Conic2D
public Conic2D.Type conicType()
conicType
in interface Conic2D
public double eccentricity()
Conic2D
eccentricity
in interface Conic2D
public Hyperbola2D reverse()
Curve2D
reverse
in interface Conic2D
reverse
in interface Curve2D
reverse
in interface Boundary2D
reverse
in interface OrientedCurve2D
reverse
in class ContourArray2D<HyperbolaBranch2D>
public java.util.Collection<Point2D> intersections(LinearShape2D line)
Curve2D
intersections
in interface Curve2D
intersections
in class CurveArray2D<HyperbolaBranch2D>
public boolean contains(Point2D point)
CurveArray2D
contains
in interface Shape2D
contains
in class CurveArray2D<HyperbolaBranch2D>
public boolean contains(double x, double y)
CurveArray2D
contains
in interface Shape2D
contains
in class CurveArray2D<HyperbolaBranch2D>
public Hyperbola2D transform(AffineTransform2D trans)
transform
in interface Conic2D
transform
in interface Curve2D
transform
in interface CurveSet2D<HyperbolaBranch2D>
transform
in interface Boundary2D
transform
in interface OrientedCurve2D
transform
in interface Shape2D
transform
in class ContourArray2D<HyperbolaBranch2D>
trans
- an affine transform
public Box2D boundingBox()
boundingBox
in interface Shape2D
boundingBox
in class CurveArray2D<HyperbolaBranch2D>
public void draw(java.awt.Graphics2D g)
draw
in interface Curve2D
draw
in interface Shape2D
draw
in class CurveArray2D<HyperbolaBranch2D>
g
- the graphics to draw the curve inpublic boolean almostEquals(GeometricObject2D obj, double eps)
GeometricObject2D
almostEquals
in interface GeometricObject2D
almostEquals
in class CurveArray2D<HyperbolaBranch2D>
obj
- the object to compareeps
- a threshold value, for example the minimal coordinate difference
public boolean equals(java.lang.Object obj)
equals
in class ContourArray2D<HyperbolaBranch2D>
public Hyperbola2D clone()
Curve2D
clone
in interface Curve2D
clone
in class CurveArray2D<HyperbolaBranch2D>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |