GM_LineString extends GM_CurveSegment implements ILineString { @Override public IDirectPosition param(double s) { double d = 0; for (int i = 0; i < this.sizeControlPoint() - 1; i++) { IDirectPosition p1 = this.getControlPoint(i); IDirectPosition p2 = this.getControlPoint(i + 1); double length = p1.distance(p2); if (s <= d + length) { IDirectPosition point = Operateurs.param(s - d, p1, p2); return point; } else { d += length; } } return null; } GM_LineString(List<IDirectPosition> list, boolean allowRepeated);  GM_LineString(List<IDirectPosition> list);  GM_LineString(IDirectPosition... list);  GM_LineString(IDirectPositionList points);  GM_LineString(IDirectPositionList points, boolean allowRepeated); @Override IDirectPositionList getControlPoint(); @Override IDirectPosition getControlPoint(int i); @Override void setControlPoint(int i, IDirectPosition value); @Override void addControlPoint(IDirectPosition value); void addControlPoint(IDirectPosition value, boolean allowRepeated); @Override void addControlPoint(int i, IDirectPosition value); @Override void removeControlPoint(IDirectPosition value); @Override void removeControlPoint(int i); @Override int sizeControlPoint(); @Override List<ILineSegment> asGM_LineSegment(); @Override IDirectPositionList coord(); @Override ILineString reverse(); @Override boolean isClosed(double tolerance); @Override boolean isClosed(); @Override Object clone(); @Override GM_LineString getNegative(); @Override boolean isLineString(); @Override String getInterpolation(); @Override IDirectPosition param(double s); @Override double[] paramForPoint(IDirectPosition p);  }
@Test public void testParam() { IDirectPosition param1 = line1.param(0); IDirectPosition param2 = line1.param(1); IDirectPosition param3 = line1.param(2); IDirectPosition param4 = line1.param(3); Assert.assertEquals(p1, param1); Assert.assertEquals(p2, param2); Assert.assertEquals(p3, param3); Assert.assertEquals(p4, param4); param1 = curve.param(0); param2 = curve.param(2); param3 = curve.param(4); param4 = curve.param(6); Assert.assertEquals(p1, param1); Assert.assertEquals(p3, param2); Assert.assertEquals(p5, param3); Assert.assertEquals(p1, param4); }