public class Hyperbola2D extends BoundarySet2D<HyperbolaBranch2D> implements Conic2D, Cloneable
Conic2D.Type| Modifier and Type | Field and Description |
|---|---|
protected double |
a
first focal parameter
|
protected double |
b
second focal parameter
|
protected HyperbolaBranch2D |
branch1
The negative branch of the hyperbola
|
protected HyperbolaBranch2D |
branch2
The positive branch of the hyperbola
|
protected boolean |
direct
a flag indicating whether the hyperbola is direct or not
|
protected double |
theta
angle of rotation of the hyperbola
|
protected double |
xc
Center of the hyperbola
|
protected double |
yc |
curves| Constructor and Description |
|---|
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) |
| Modifier and Type | Method and Description |
|---|---|
Hyperbola2D |
clone()
Overrides Object declaration to ensure Curve2D implementation are
cloned as Curve2D.
|
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(Graphics2D g)
Throws an UnboundedShapeException
|
boolean |
equals(Object obj)
Tests whether this hyperbola equals another object.
|
double |
getAngle()
Returns the angle made by the first direction vector with the horizontal
axis.
|
Collection<StraightLine2D> |
getAsymptotes()
Returns the asymptotes of the hyperbola.
|
Collection<HyperbolaBranch2D> |
getBranches() |
Point2D |
getCenter()
Returns the center of the Hyperbola.
|
double[] |
getConicCoefficients()
Returns the coefficient of the Cartesian representation of the conic.
|
Conic2D.Type |
getConicType() |
double |
getEccentricity()
Returns the eccentricity of the conic.
|
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.
|
Collection<Point2D> |
getIntersections(LinearShape2D line)
Returns the intersection points of the curve with the specified line.
|
double |
getLength1()
Returns a
|
double |
getLength2()
Returns b
|
HyperbolaBranch2D |
getNegativeBranch() |
HyperbolaBranch2D |
getPositiveBranch() |
Hyperbola2D |
getReverseCurve()
Returns the curve with same trace on the plane with parametrization in
reverse order.
|
Vector2D |
getVector1() |
Vector2D |
getVector2() |
boolean |
isDirect() |
static Hyperbola2D |
reduceCentered(double[] coefs)
Creates a new Hyperbola by reducing the conic coefficients, assuming
conic type is Hyperbola, and hyperbola is centered.
|
Point2D |
toGlobal(Point2D point)
transform 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.
|
clip, create, create, fill, getBoundaryCurves, getDomain, getSignedDistance, getSignedDistance, getSubCurve, getWindingAngle, isInsideaddCurve, clearCurves, containsCurve, getAsAWTShape, getBoundingBox, getChildCurve, getContinuousCurves, getCurve, getCurveIndex, getCurveNumber, getCurves, getDistance, getDistance, getFirstCurve, getFirstPoint, getGeneralPath, getGlobalPosition, getLastCurve, getLastPoint, getLocalPosition, getPoint, getPosition, getSingularPoints, getT0, getT1, isBounded, isEmpty, isSingular, iterator, project, removeCurvefromUnitSegment, toUnitSegmentfinalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitfill, getBoundaryCurves, getDomain, isInsidegetSignedDistance, getSignedDistance, getWindingAnglegetAsAWTShape, getContinuousCurves, getFirstPoint, getLastPoint, getPoint, getPosition, getSingularPoints, getSubCurve, getT0, getT1, isSingular, projectgetBoundingBox, getDistance, getDistance, isBounded, isEmptyprotected double xc
protected double yc
protected double a
protected double b
protected double theta
protected boolean direct
protected HyperbolaBranch2D branch1
protected HyperbolaBranch2D branch2
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)
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 transformpublic Point2D toGlobal(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 getPositiveBranch()
public HyperbolaBranch2D getNegativeBranch()
public Collection<HyperbolaBranch2D> getBranches()
public Collection<StraightLine2D> getAsymptotes()
public double[] getConicCoefficients()
Conic2Da*x^2 + b*x*y + c*y^2 + d*x + e*y + f
The length of the array is then of size 6.
getConicCoefficients in interface Conic2Dpublic Conic2D.Type getConicType()
getConicType in interface Conic2Dpublic double getEccentricity()
Conic2DgetEccentricity in interface Conic2Dpublic Hyperbola2D getReverseCurve()
Curve2DgetReverseCurve in interface Conic2DgetReverseCurve in interface Curve2DgetReverseCurve in interface Boundary2DgetReverseCurve in interface OrientedCurve2DgetReverseCurve in class BoundarySet2D<HyperbolaBranch2D>public Collection<Point2D> getIntersections(LinearShape2D line)
Curve2DgetIntersections in interface Curve2DgetIntersections in class CurveArray2D<HyperbolaBranch2D>public boolean contains(Point2D point)
CurveArray2Dcontains in interface Shape2Dcontains in class CurveArray2D<HyperbolaBranch2D>public boolean contains(double x,
double y)
CurveArray2Dcontains in interface Shape2Dcontains in class CurveArray2D<HyperbolaBranch2D>public Hyperbola2D transform(AffineTransform2D trans)
transform in interface Conic2Dtransform in interface Curve2Dtransform in interface Boundary2Dtransform in interface OrientedCurve2Dtransform in interface Shape2Dtransform in class BoundarySet2D<HyperbolaBranch2D>trans - an affine transformpublic void draw(Graphics2D g)
draw in interface Curve2Ddraw in interface Shape2Ddraw in class CurveArray2D<HyperbolaBranch2D>g - the graphics to draw the curvepublic boolean equals(Object obj)
equals in class CurveArray2D<HyperbolaBranch2D>public Hyperbola2D clone()
Curve2Dclone in interface Curve2Dclone in class CurveArray2D<HyperbolaBranch2D>Copyright © 2012 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.