math.geom2d.curve
Interface Curve2D

All Superinterfaces:
java.awt.Shape, Shape2D
All Known Subinterfaces:
Boundary2D, Conic2D, ContinuousBoundary2D, ContinuousCurve2D, ContinuousOrientedCurve2D, OrientedCurve2D, SmoothCurve2D, SmoothOrientedCurve2D
All Known Implementing Classes:
BezierCurve2D, BoundaryPolyCurve2D, BoundarySet2D, Circle2D, CircleArc2D, ClosedPolyline2D, CurveSet2D, Ellipse2D, EllipseArc2D, Hyperbola2D, HyperbolaBranch2D, HyperbolaBranchArc2D, LineArc2D, LineObject2D, LineSegment2D, Parabola2D, ParabolaArc2D, ParametricConic2D, PolyBezierCurve2D, PolyCurve2D, Polyline2D, PolyOrientedCurve2D, Ray2D, StraightLine2D, StraightObject2D

public interface Curve2D
extends Shape2D

Interface for all linear and pieces smooth curves : polylines, conics, lines ... A Curve2D object can be a continuous object (line, spiral, conic, ...), or the boundary of a Region. It can also be the union of several continuous curves.

Paramaterized curves are actually considered. Parameterization is left to the implementation.


Field Summary
 
Fields inherited from interface math.geom2d.Shape2D
ACCURACY, defaultClipWindow, EMPTY_SET
 
Method Summary
 CurveSet2D<? extends Curve2D> clip(Box2D box)
          When a curve is clipped, the result is a set of curves.
 java.util.Collection<? extends ContinuousCurve2D> getContinuousCurves()
          Returns the collection of continuous curves which constitute this curve.
 Point2D getFirstPoint()
          Get the first point of the curve.
 java.util.Collection<Point2D> getIntersections(StraightObject2D line)
          Returns the intersection points of the curve with the specified line.
 Point2D getLastPoint()
          Get the last point of the curve.
 Point2D getPoint(double t)
          Gets the point from a parametric representation of the curve.
 Point2D getPoint(double t, Point2D point)
          Same as getPoint(t), but gives the point as a parameter.
 double getPosition(Point2D point)
          Get position of the point on the curve.
 Curve2D getReverseCurve()
          Returns the curve with same trace on the plane with parametrization in reverse order.
 Curve2D getSubCurve(double t0, double t1)
          Returns a portion of the original curve, delimited by two positions on the curve.
 double getT0()
          Get value of parameter t for the first point of the curve.
 double getT1()
          Get value of parameter t for the last point of the curve.
 double project(Point2D point)
          Returns the position of the closest orthogonal projection of the point on the curve, or of the closest singular point.
 Curve2D transform(AffineTransform2D trans)
          Transforms the curve by an affine transform.
 
Methods inherited from interface math.geom2d.Shape2D
getBoundingBox, getDistance, getDistance, isBounded
 
Methods inherited from interface java.awt.Shape
contains, contains, contains, contains, getBounds, getBounds2D, getPathIterator, getPathIterator, intersects, intersects
 

Method Detail

getT0

double getT0()
Get value of parameter t for the first point of the curve. It can be -Infinity, in this case the piece of curve is not bounded.


getT1

double getT1()
Get value of parameter t for the last point of the curve. It can be +Infinity, in this case the piece of curve is not bounded.


getPoint

Point2D getPoint(double t)
Gets the point from a parametric representation of the curve. If the parameter lies outside the definition range, the parameter corresponding to the closest bound is used instead. This method can be used to draw an approximated outline of a curve, by selecting multiple values for t and drawing lines between them.


getPoint

Point2D getPoint(double t,
                 Point2D point)
Same as getPoint(t), but gives the point as a parameter. This avoids repetitive memory allocations.


getFirstPoint

Point2D getFirstPoint()
Get the first point of the curve. It must returns the same result as getPoint(getT0()).

Returns:
the first point of the curve

getLastPoint

Point2D getLastPoint()
Get the last point of the curve. It must returns the same result as getPoint(getT1()).

Returns:
the last point of the curve.

getPosition

double getPosition(Point2D point)
Get position of the point on the curve. If the point does not belong to the curve, return Double.NaN.

Parameters:
point - a point belonging to the curve
Returns:
the position of the point on the curve

project

double project(Point2D point)
Returns the position of the closest orthogonal projection of the point on the curve, or of the closest singular point. This function should always returns a valid value.

Parameters:
point - a point to project
Returns:
the position of the closest orthogonal projection

getIntersections

java.util.Collection<Point2D> getIntersections(StraightObject2D line)
Returns the intersection points of the curve with the specified line. The length of the result array is the number of intersection points.


getReverseCurve

Curve2D getReverseCurve()
Returns the curve with same trace on the plane with parametrization in reverse order.


getContinuousCurves

java.util.Collection<? extends ContinuousCurve2D> getContinuousCurves()
Returns the collection of continuous curves which constitute this curve.

Returns:
a collection of continuous curves.

getSubCurve

Curve2D getSubCurve(double t0,
                    double t1)
Returns a portion of the original curve, delimited by two positions on the curve.

Parameters:
t0 - position of the start of the sub-curve
t1 - position of the end of the sub-curve
Returns:
the portion of original curve comprised between t0 and t1.

transform

Curve2D transform(AffineTransform2D trans)
Transforms the curve by an affine transform. The result is an instance of Curve2D.

Specified by:
transform in interface Shape2D
Parameters:
trans - an affine transform
Returns:
the transformed shape

clip

CurveSet2D<? extends Curve2D> clip(Box2D box)
When a curve is clipped, the result is a set of curves.

Specified by:
clip in interface Shape2D
Parameters:
box - the clipping box
Returns:
the clipped shape