1 /**
2 * File: CirculinearCurve2D.java
3 * Project: javaGeom
4 *
5 * Distributed under the LGPL License.
6 *
7 * Created: 11 mai 09
8 */
9 package math.geom2d.circulinear;
10
11 import java.util.Collection;
12
13 import math.geom2d.Box2D;
14 import math.geom2d.curve.Curve2D;
15 import math.geom2d.curve.CurveSet2D;
16 import math.geom2d.transform.CircleInversion2D;
17
18
19 /**
20 * <p>
21 * Circulinear curve are composed of linear and/or circular elements.
22 * Linear elements are line segments, straight lines, rays...
23 * Circular elements are circles and circle arcs.</p>
24 * <p>
25 * Circulinear curves provide a convenient way to store result of geometric
26 * operation like buffer computation. Moreover, the set of circulinear curves
27 * is stable with respect to circle inversion.</p>
28 * @author dlegland
29 *
30 */
31 public interface CirculinearCurve2D extends CirculinearShape2D, Curve2D {
32
33 /**
34 * @return the length of the curve
35 */
36 public double getLength();
37
38 /**
39 * @return the length from the beginning to the position given by pos
40 */
41 public double getLength(double pos);
42
43 /**
44 * @return the position located at distance 'length' from the origin
45 */
46 public double getPosition(double length);
47
48
49 /**
50 * Creates a new curve, formed by the points with parameterization:
51 * <code> p(t) = c(t) + d*n(t)/|n(t)|</code>, with p(t) being a point of
52 * the original curve, n(t) the normal of the curve, and |n| being the
53 * norm of n.<br>
54 * In the case of a continuous curve formed by several smooth circulinear
55 * elements, the parallels of contiguous elements are joined by a circle
56 * arc.
57 * @param d the distance between the original curve and he parallel curve.
58 * @return the parallel curve
59 */
60 public Curve2D getParallel(double d);
61
62 // ===================================================================
63 // redefines declaration of some parent interfaces
64
65 public Curve2D transform(CircleInversion2D inv);
66
67 /**
68 * Returns the collection of continuous circulinear curves which
69 * constitute this curve.
70 *
71 * @return a collection of continuous circulinear curves.
72 */
73 public Collection<? extends CirculinearContinuousCurve2D> getContinuousCurves();
74
75 public CurveSet2D clip(Box2D box);
76 public Curve2D getSubCurve(double t0, double t1);
77 public Curve2D getReverseCurve();
78 }