 }
 
 private func SplitBezier(_ t: Double, _ p: [Double]) -> ([Double], [Double]) {
+    if t.almostZero() {
+        return (Array(repeating: p.first ?? 0, count: p.count), p)
+    }
+    if t.almostEqual(1) {
+        return (p, Array(repeating: p.last ?? 0, count: p.count))
+    }
     let _t = 1 - t
     if p.count == 2 {
         let split = _t * p.first! + t * p.last!

}

private func SplitBezier(_ t: Double, _ p: [Vector]) -> ([Vector], [Vector]) {
    let _t = 1 - t
    if p.count == 2 {
        let split = _t * p.first! + t * p.last!

}

private func SplitBezier(_ t: Double, _ p: [Point]) -> ([Point], [Point]) {
    if t.almostZero() {
        return (Array(repeating: p.first ?? Point(), count: p.count), p)
    }
    if t.almostEqual(1) {
        return (p, Array(repeating: p.last ?? Point(), count: p.count))
    }
    let _t = 1 - t
    if p.count == 2 {
        let split = _t * p.first! + t * p.last!
