math.geom2d.conic
Class Hyperbola2D

java.lang.Object
  extended by math.geom2d.curve.CurveSet2D<T>
      extended by math.geom2d.curve.BoundarySet2D<HyperbolaBranch2D>
          extended by math.geom2d.conic.Hyperbola2D
All Implemented Interfaces:
java.awt.Shape, java.lang.Iterable<HyperbolaBranch2D>, Conic2D, Boundary2D, Curve2D, OrientedCurve2D, Shape2D

public class Hyperbola2D
extends BoundarySet2D<HyperbolaBranch2D>
implements Conic2D

Superclass for all linear and pieces smooth curves : polylines, conics, lines ...


Field Summary
 
Fields inherited from class math.geom2d.curve.CurveSet2D
curves
 
Fields inherited from interface math.geom2d.conic.Conic2D
CIRCLE, ELLIPSE, HYPERBOLA, NOT_A_CONIC, PARABOLA, POINT, STRAIGHT_LINE, TWO_LINES
 
Fields inherited from interface math.geom2d.Shape2D
ACCURACY, defaultClipWindow, EMPTY_SET
 
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, boolean d)
          Main constructor
Hyperbola2D(Point2D center, double a, double b, double theta, boolean d)
           
 
Method Summary
 boolean contains(double x, double y)
          return true if one of the curves contains the point
 boolean contains(java.awt.geom.Point2D point)
          return true if one of the curves contains the point
 boolean equals(java.lang.Object obj)
          Tests whether this hyperbola equals another object.
 double getAngle()
           
 double[] getCartesianEquation()
          Return the coefficient of the cartesian representation of the conic.
 Point2D getCenter()
           
 int getConicType()
           
 double getEccentricity()
          Return eccentricity of the conic.
 Point2D getFocus1()
           
 Point2D getFocus2()
           
 java.util.Collection<Point2D> getIntersections(StraightObject2D line)
          Returns the intersection points of the curve with the specified line.
 double getLength1()
          Return 0
 double getLength2()
          Return 0
 Hyperbola2D getReverseCurve()
          Returns the curve with same trace on the plane with parametrization in reverse order.
 Vector2D getVector1()
           
 Vector2D getVector2()
           
 boolean isDirect()
           
 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)
          Transform each curve, and build a new CurveSet2D with the set of transformed curves.
 
Methods inherited from class math.geom2d.curve.BoundarySet2D
clip, getBoundaryCurves, getSignedDistance, getSignedDistance, getSubCurve, getWindingAngle, isInside
 
Methods inherited from class math.geom2d.curve.CurveSet2D
addCurve, clearCurves, contains, contains, fromUnitSegment, getBoundingBox, getBounds, getBounds2D, getContinuousCurves, getCurveNumber, getCurves, getDistance, getDistance, getFirstCurve, getFirstPoint, getGeneralPath, getLastCurve, getLastPoint, getPathIterator, getPathIterator, getPoint, getPoint, getPosition, getT0, getT1, intersects, intersects, isBounded, isEmpty, iterator, project, removeCurve, toUnitSegment
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface math.geom2d.conic.Conic2D
clip
 
Methods inherited from interface math.geom2d.curve.OrientedCurve2D
getSignedDistance, getSignedDistance, getWindingAngle, isInside
 
Methods inherited from interface math.geom2d.curve.Curve2D
getContinuousCurves, getFirstPoint, getLastPoint, getPoint, getPoint, getPosition, getSubCurve, getT0, getT1, project
 
Methods inherited from interface math.geom2d.Shape2D
getBoundingBox, getDistance, getDistance, isBounded
 
Methods inherited from interface java.awt.Shape
contains, contains, getBounds, getBounds2D, getPathIterator, getPathIterator, intersects, intersects
 

Constructor Detail

Hyperbola2D

public Hyperbola2D()
Assume centered hyperbola, with a = b = 1 (orthogonal hyperbola), theta=0 (hyperbola is oriented East-West), and direct orientation.


Hyperbola2D

public Hyperbola2D(Point2D center,
                   double a,
                   double b,
                   double theta,
                   boolean d)

Hyperbola2D

public Hyperbola2D(double xc,
                   double yc,
                   double a,
                   double b,
                   double theta,
                   boolean d)
Main constructor

Method Detail

toGlobal

public Point2D toGlobal(Point2D point)
transform a point in local coordinate (ie orthogonal centered hyberbola with a=b=1) to global coordinate system.


toLocal

public Point2D toLocal(Point2D point)

getAngle

public double getAngle()

getCartesianEquation

public double[] getCartesianEquation()
Description copied from interface: Conic2D
Return the coefficient of the cartesian representation of the conic. Cartesian equation has the form :

a*x^2 + b*x*y + c*y^2 + d*x + e*y + f

The length of the array is then of size 6.

Specified by:
getCartesianEquation in interface Conic2D

getCenter

public Point2D getCenter()

getConicType

public int getConicType()
Specified by:
getConicType in interface Conic2D

getEccentricity

public double getEccentricity()
Description copied from interface: Conic2D
Return eccentricity of the conic.

Specified by:
getEccentricity in interface Conic2D

getFocus1

public Point2D getFocus1()

getFocus2

public Point2D getFocus2()

getLength1

public double getLength1()
Return 0


getLength2

public double getLength2()
Return 0


getVector1

public Vector2D getVector1()

getVector2

public Vector2D getVector2()

isDirect

public boolean isDirect()

contains

public boolean contains(java.awt.geom.Point2D point)
Description copied from class: CurveSet2D
return true if one of the curves contains the point

Specified by:
contains in interface java.awt.Shape
Overrides:
contains in class CurveSet2D<HyperbolaBranch2D>

contains

public boolean contains(double x,
                        double y)
Description copied from class: CurveSet2D
return true if one of the curves contains the point

Specified by:
contains in interface java.awt.Shape
Overrides:
contains in class CurveSet2D<HyperbolaBranch2D>

getReverseCurve

public Hyperbola2D getReverseCurve()
Description copied from interface: Curve2D
Returns the curve with same trace on the plane with parametrization in reverse order.

Specified by:
getReverseCurve in interface Conic2D
Specified by:
getReverseCurve in interface Boundary2D
Specified by:
getReverseCurve in interface Curve2D
Specified by:
getReverseCurve in interface OrientedCurve2D
Overrides:
getReverseCurve in class BoundarySet2D<HyperbolaBranch2D>

getIntersections

public java.util.Collection<Point2D> getIntersections(StraightObject2D line)
Description copied from interface: Curve2D
Returns the intersection points of the curve with the specified line. The length of the result array is the number of intersection points.

Specified by:
getIntersections in interface Curve2D
Overrides:
getIntersections in class CurveSet2D<HyperbolaBranch2D>

transform

public Hyperbola2D transform(AffineTransform2D trans)
Description copied from class: CurveSet2D
Transform each curve, and build a new CurveSet2D with the set of transformed curves.

Specified by:
transform in interface Conic2D
Specified by:
transform in interface Boundary2D
Specified by:
transform in interface Curve2D
Specified by:
transform in interface OrientedCurve2D
Specified by:
transform in interface Shape2D
Overrides:
transform in class BoundarySet2D<HyperbolaBranch2D>
Parameters:
trans - an affine transform
Returns:
the transformed shape

equals

public boolean equals(java.lang.Object obj)
Tests whether this hyperbola equals another object.

Overrides:
equals in class CurveSet2D<HyperbolaBranch2D>