 
       c
 
-  ###
-  @param {Point[]} knots Array of points that the spline passes through. A curve is generated connecting each knot point to the next.
-  @param {boolean} [closed] Indicates that the spline should connect its end point back to its start point, making a loop.
-  @property {boolean} closed Indicates that the spline should connect its end point back to its start point, making a loop.
-  @property {BezierCurve[]} curves List of curves that make up the spline
-  @property {number[]} startLengths The length of the whole spline up to the start of each segment curve
-  @property {number[]} endLengths The length of the whole spline up to the end of each segment curve
-  @property {number} length The length of the entire spline
-  ###
   constructor: (knots, closed) ->
+    ###
+
+    * knots: Point[]. Array of points that the spline passes through. A curve is generated connecting each knot point to the next.
+    * closed: Boolean. Default false. Indicates that the spline should connect its end point back to its start point, making a loop.
+    ###
     @closed = closed;
     @curves = BezierSpline.computeBezierSpline(knots.map((p) -> p.x), knots.map((p) -> p.y), closed);
     @startLengths = (c.startLength for c in @curves)

    else
      { i:i, t:t }

  ###
  Computes the point at position t of the curve.
  @param {number} t The portion of the curve to consider. The spline starts at t=0 and ends at t=curves.length.
  @returns {Point} the location point.
  ###
  point: (t) ->
    a = @_curveIndex(t)
    @curves[a.i].point(a.t)

  ###
  Computes the point at length z of the curve.
  @param {number} z The length of the curve to travel.
  @returns {Point} the location point.
  ###
  pointAtLength: (z) ->
    findCurveIndex = (lengths, z, start, stop) ->
      mid = start + stop >>> 1
      switch

      @_findT(target, guess - error / 2);

  # adapted from: https://github.com/DmitryBaranovskiy/raphael/blob/c47c077368c1113e1ed653376415961749de5466/dev/raphael.core.js
  lengthAt: (t = 1) ->
    ###
    Computes the length at position t of the curve.

    * t: Number. The portion of the curve to consider. The curve starts at t=0 and ends at t=1.
    * Returns number, the length value.
    ###
    t = if t > 1 then 1 else if t < 0 then 0 else t
    t2 = t / 2

