math.geom2d.curve
Interface ContinuousCurve2D

All Superinterfaces:
java.lang.Cloneable, Curve2D, GeometricObject2D, Shape2D
All Known Subinterfaces:
CircleLine2D, CircularShape2D, CirculinearContinuousCurve2D, CirculinearContour2D, CirculinearElement2D, CirculinearRing2D, ContinuousOrientedCurve2D, Contour2D, EllipseArcShape2D, EllipseShape2D, LinearElement2D, SmoothContour2D, SmoothCurve2D, SmoothOrientedCurve2D
All Known Implementing Classes:
AbstractContinuousCurve2D, AbstractLine2D, AbstractSmoothCurve2D, BoundaryPolyCirculinearCurve2D, BoundaryPolyCurve2D, Circle2D, CircleArc2D, CubicBezierCurve2D, Ellipse2D, EllipseArc2D, GenericCirculinearRing2D, HyperbolaBranch2D, HyperbolaBranchArc2D, InvertedRay2D, Line2D, LineArc2D, LinearCurve2D, LinearRing2D, LineSegment2D, Parabola2D, ParabolaArc2D, PolyCirculinearCurve2D, PolyCubicBezierCurve2D, PolyCurve2D, Polyline2D, PolyOrientedCurve2D, QuadBezierCurve2D, Ray2D, StraightLine2D

public interface ContinuousCurve2D
extends Curve2D

Interface for all curves which can be drawn with one stroke. This includes closed curves (ellipses, polygon boundaries...), infinite curves (straight lines, parabolas, ...), and 'finite' curves, such as polylines, conic arcs, line segments, splines... Note that an hyperbola is compound of 2 continuous curves.

Such curves accept parametric representation, in the form : p(t)={x(t),y(t)}, with t contained in appropriate domain. Bounds of domain of definition can be obtained by methods t0() and t1().


Field Summary
 
Fields inherited from interface math.geom2d.Shape2D
ACCURACY
 
Method Summary
 java.awt.geom.GeneralPath appendPath(java.awt.geom.GeneralPath path)
          Append the path of the curve to the given path.
 LinearCurve2D asPolyline(int n)
          Returns an approximation of the curve as a polyline with n line segments.
 CurveSet2D<? extends ContinuousCurve2D> clip(Box2D box)
          When a curve is clipped, the result is a set of curves.
 double curvature(double t)
          Computes the curvature at the given position.
 boolean isClosed()
          Returns true if the curve makes a loop, that is come back to starting point after covering the path.
 Vector2D leftTangent(double t)
          Computes the left tangent at the given position.
 ContinuousCurve2D reverse()
          Returns the curve with same trace on the plane with parameterization in reverse order.
 Vector2D rightTangent(double t)
          Computes the right tangent at the given position.
 java.util.Collection<? extends SmoothCurve2D> smoothPieces()
          Returns a set of smooth curves.
 ContinuousCurve2D subCurve(double t0, double t1)
          Returns a portion of the original curve, delimited by two positions on the curve.
 ContinuousCurve2D transform(AffineTransform2D trans)
          Transforms the curve by an affine transform.
 
Methods inherited from interface math.geom2d.curve.Curve2D
asAwtShape, clone, continuousCurves, draw, firstPoint, getT0, getT1, intersections, isSingular, lastPoint, point, position, project, singularPoints, t0, t1, vertices
 
Methods inherited from interface math.geom2d.Shape2D
boundingBox, contains, contains, distance, distance, isBounded, isEmpty
 
Methods inherited from interface math.geom2d.GeometricObject2D
almostEquals
 

Method Detail

isClosed

boolean isClosed()
Returns true if the curve makes a loop, that is come back to starting point after covering the path.


leftTangent

Vector2D leftTangent(double t)
Computes the left tangent at the given position. If the curve is smooth at position t, the result is the same as the tangent computed for the corresponding smooth curve, and is equal to the result of rightTangent(double). If the position t corresponds to a singular point, the tangent of the smooth portion before t is computed.

Parameters:
t - the position on the curve
Returns:
the left tangent vector at the curve for position t

rightTangent

Vector2D rightTangent(double t)
Computes the right tangent at the given position. If the curve is smooth at position t, the result is the same as the tangent computed for the corresponding smooth curve, and is equal to the result of leftTangent(double). If the position t corresponds to a singular point, the tangent of the smooth portion after t is computed.

Parameters:
t - the position on the curve
Returns:
the right tangent vector at the curve for position t

curvature

double curvature(double t)
Computes the curvature at the given position. The curvature is finite for positions t that correspond to smooth parts, and is infinite for singular points.

Parameters:
t - the position on the curve
Returns:
the curvature of the curve for position t

smoothPieces

java.util.Collection<? extends SmoothCurve2D> smoothPieces()
Returns a set of smooth curves.


asPolyline

LinearCurve2D asPolyline(int n)
Returns an approximation of the curve as a polyline with n line segments. If the curve is closed, the method should return an instance of LinearRing2D. Otherwise, it returns an instance of Polyline2D.

Parameters:
n - the number of line segments
Returns:
a polyline with n line segments.

appendPath

java.awt.geom.GeneralPath appendPath(java.awt.geom.GeneralPath path)
Append the path of the curve to the given path.

Parameters:
path - a path to modify
Returns:
the modified path

reverse

ContinuousCurve2D reverse()
Description copied from interface: Curve2D
Returns the curve with same trace on the plane with parameterization in reverse order.

Specified by:
reverse in interface Curve2D

subCurve

ContinuousCurve2D subCurve(double t0,
                           double t1)
Description copied from interface: Curve2D
Returns a portion of the original curve, delimited by two positions on the curve.

Specified by:
subCurve in interface Curve2D
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.

clip

CurveSet2D<? extends ContinuousCurve2D> clip(Box2D box)
Description copied from interface: Curve2D
When a curve is clipped, the result is a set of curves.

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

transform

ContinuousCurve2D transform(AffineTransform2D trans)
Description copied from interface: Curve2D
Transforms the curve by an affine transform. The result is an instance of Curve2D.

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