 }
 
 private func BezierDerivative(p: [Vector]) -> [Vector] {
-    let n = Double(p.count)
+    let n = Double(p.count - 1)
     var de = [Vector]()
     var lastPoint = p.first!
     for current in p.dropFirst() {

}

@warn_unused_result
public func BezierDerivative(t: Double, _ p: Double ... ) -> Double {
    return Bezier(t, BezierDerivative(p))
}

@warn_unused_result
public func BezierDerivative(t: Double, _ p: Point ... ) -> Point {
    return Bezier(t, BezierDerivative(p))
}

@warn_unused_result
public func BezierDerivative(t: Double, _ p: Vector ... ) -> Vector {
    return Bezier(t, BezierDerivative(p))
}

@warn_unused_result
public func BezierDerivative(p: Double ... ) -> [Double] {
    return BezierDerivative(p)
}

}

private func BezierDerivative(p: [Point]) -> [Point] {
    let n = Double(p.count - 1)
    var de = [Point]()
    var lastPoint = p.first!
    for current in p.dropFirst() {
