math.geom2d.curve
Interface Curve2D
-
- All Superinterfaces:
- java.lang.Cloneable, GeometricObject2D, Shape2D
- All Known Subinterfaces:
- Boundary2D, CircleLine2D, CircularShape2D, CirculinearBoundary2D, CirculinearContinuousCurve2D, CirculinearContour2D, CirculinearCurve2D, CirculinearCurveSet2D<T>, CirculinearElement2D, CirculinearRing2D, Conic2D, ContinuousCurve2D, ContinuousOrientedCurve2D, Contour2D, CurveSet2D<T>, EllipseArcShape2D, EllipseShape2D, LinearElement2D, LinearShape2D, OrientedCurve2D, SmoothContour2D, SmoothCurve2D, SmoothOrientedCurve2D
- All Known Implementing Classes:
- AbstractContinuousCurve2D, AbstractLine2D, AbstractSmoothCurve2D, BoundaryPolyCirculinearCurve2D, BoundaryPolyCurve2D, Circle2D, CircleArc2D, CirculinearContourArray2D, CirculinearCurveArray2D, ContourArray2D, CubicBezierCurve2D, CurveArray2D, Ellipse2D, EllipseArc2D, GeneralPath2D, GenericCirculinearRing2D, Hyperbola2D, HyperbolaBranch2D, HyperbolaBranchArc2D, InvertedRay2D, Line2D, LineArc2D, LinearCurve2D, LinearRing2D, LineSegment2D, Parabola2D, ParabolaArc2D, PolyCirculinearCurve2D, PolyCubicBezierCurve2D, PolyCurve2D, Polyline2D, PolyOrientedCurve2D, QuadBezierCurve2D, Ray2D, StraightLine2D
public interface Curve2D extends Shape2D, java.lang.Cloneable
Interface for piecewise smooth curves, like polylines, conics, straight lines, line segments...
Several interfaces exist to use more explicit type of curves:
ContinuousCurve2Dfor finite or infinite continuous curves,SmoothCurve2Dfor curves that admit a derivative (and hence a tangent, a curvature...) at each point,OrientedCurve2Dthat are used to define theboundaryof adomain...Points on curves are identified using curve parameterization. This parameterization is left to the implementation.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method and Description java.awt.ShapeasAwtShape()CurveSet2D<? extends Curve2D>clip(Box2D box)When a curve is clipped, the result is a set of curves.Curve2Dclone()Deprecated.use copy constructor instead (0.11.2)java.util.Collection<? extends ContinuousCurve2D>continuousCurves()Returns the collection of continuous curves which constitute this curve.voiddraw(java.awt.Graphics2D g2)Draws the curve on the given Graphics2D object.Point2DfirstPoint()Returns the first point of the curve.doublegetT0()Deprecated.replaced by t0() (since 0.11.1).doublegetT1()Deprecated.replaced by t1() (since 0.11.1).java.util.Collection<Point2D>intersections(LinearShape2D line)Returns the intersection points of the curve with the specified line.booleanisSingular(double pos)Checks if a point is singular.Point2DlastPoint()Returns the last point of the curve.Point2Dpoint(double t)Returns the point located at the given position on the curve.doubleposition(Point2D point)Computes the position of the point on the curve.doubleproject(Point2D point)Returns the position of the closest orthogonal projection of the point on the curve, or of the closest singular point.Curve2Dreverse()Returns the curve with same trace on the plane with parameterization in reverse order.java.util.Collection<Point2D>singularPoints()Returns a set of singular points, i.Curve2DsubCurve(double t0, double t1)Returns a portion of the original curve, delimited by two positions on the curve.doublet0()Get value of parameter t for the first point of the curve.doublet1()Get value of parameter t for the last point of the curve.Curve2Dtransform(AffineTransform2D trans)Transforms the curve by an affine transform.java.util.Collection<Point2D>vertices()Returns the set of vertices for this curve.-
Methods inherited from interface math.geom2d.Shape2D
boundingBox, contains, contains, distance, distance, isBounded, isEmpty
-
Methods inherited from interface math.geom2d.GeometricObject2D
almostEquals
-
-
-
-
Method Detail
-
t0
double t0()
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.
-
getT0
@Deprecated double getT0()
Deprecated. replaced by t0() (since 0.11.1).
-
t1
double t1()
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.
-
getT1
@Deprecated double getT1()
Deprecated. replaced by t1() (since 0.11.1).
-
point
Point2D point(double t)
Returns the point located at the given position on 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.
-
firstPoint
Point2D firstPoint()
Returns the first point of the curve. It must returns the same result aspoint(t0()).- Returns:
- the first point of the curve
- See Also:
t0(),point(double)
-
lastPoint
Point2D lastPoint()
Returns the last point of the curve. It must returns the same result asthis.point(this.t1()).- Returns:
- the last point of the curve.
- See Also:
t1(),point(double)
-
singularPoints
java.util.Collection<Point2D> singularPoints()
Returns a set of singular points, i. e. which do not locally admit derivative.- Returns:
- a collection of Point2D.
- See Also:
vertices()
-
vertices
java.util.Collection<Point2D> vertices()
Returns the set of vertices for this curve. Vertices can be either singular points, or extremities.- Returns:
- a collection of Point2D.
- See Also:
singularPoints()
-
isSingular
boolean isSingular(double pos)
Checks if a point is singular.- Parameters:
pos- the position of the point on the curve- Returns:
- true if the point at this location is singular
-
position
double position(Point2D point)
Computes the position of the point on the curve. If the point does not belong to the curve, return Double.NaN. It is complementary to thepoint(double)method.- Parameters:
point- a point belonging to the curve- Returns:
- the position of the point on the curve
- See Also:
point(double)
-
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
-
intersections
java.util.Collection<Point2D> intersections(LinearShape2D line)
Returns the intersection points of the curve with the specified line. The length of the result array is the number of intersection points.
-
reverse
Curve2D reverse()
Returns the curve with same trace on the plane with parameterization in reverse order.
-
continuousCurves
java.util.Collection<? extends ContinuousCurve2D> continuousCurves()
Returns the collection of continuous curves which constitute this curve.- Returns:
- a collection of continuous curves.
-
subCurve
Curve2D subCurve(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-curvet1- 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.
-
clip
CurveSet2D<? extends Curve2D> clip(Box2D box)
When a curve is clipped, the result is a set of curves.
-
asAwtShape
java.awt.Shape asAwtShape()
- Returns:
- the shape corresponding to this curve
- Since:
- 0.7.1
-
draw
void draw(java.awt.Graphics2D g2)
Draws the curve on the given Graphics2D object.
-
clone
@Deprecated Curve2D clone()
Deprecated. use copy constructor instead (0.11.2)
-
-
DMelt 3.0 © DataMelt by jWork.ORG