     }
     
     @inlinable
+    public func _closest(_ p: Point) -> Double? {
+        return self.__closest(p).flatMap(split_check)
+    }
+    
+    @inlinable
     public func closest(_ p: Point) -> Double {
-        if p.distance(to: self.start) < p.distance(to: self.end) {
-            return self._closest(p).flatMap(split_check) ?? 0
-        } else {
-            return self._closest(p).flatMap(split_check) ?? 1
-        }
+        let min = p.distance(to: self.start) < p.distance(to: self.end) ? 0 : 1
+        return self._closest(p) ?? min
     }
     
     @inlinable

            switch other.segment {
            case let .line(q1):
                if let p = LineSegment(start, p1).intersect(LineSegment(other.start, q1)) {
                    result = [(_closest(p), other._closest(p))].compactMap(split_check)
                }
            case let .quad(q1, q2):
                if let t = QuadBezier(other.start, q1, q2).intersect(LineSegment(start, p1), in: -0.5...1.5) {
                    result = t.map { (_closest(QuadBezier(other.start, q1, q2).eval($0)), $0) }.compactMap(split_check).sorted { $0.0 }
                }
            case let .cubic(q1, q2, q3):
                if let t = CubicBezier(other.start, q1, q2, q3).intersect(LineSegment(start, p1), in: -0.5...1.5) {
                    result = t.map { (_closest(CubicBezier(other.start, q1, q2, q3).eval($0)), $0) }.compactMap(split_check).sorted { $0.0 }
                }
            }
        case let .quad(p1, p2):
            switch other.segment {
            case let .line(q1):
                if let t = QuadBezier(start, p1, p2).intersect(LineSegment(other.start, q1), in: -0.5...1.5) {
                    result = t.map { ($0, other._closest(QuadBezier(start, p1, p2).eval($0))) }.compactMap(split_check).sorted { $0.0 }
                }
            case let .quad(q1, q2):
                if let t = QuadBezier(start, p1, p2).intersect(QuadBezier(other.start, q1, q2), in: -0.5...1.5) {
                    result = t.map { ($0, other._closest(QuadBezier(start, p1, p2).eval($0))) }.compactMap(split_check).sorted { $0.0 }
                }
            case let .cubic(q1, q2, q3):
                if let t = CubicBezier(other.start, q1, q2, q3).intersect(QuadBezier(start, p1, p2), in: -0.5...1.5) {
                    result = t.map { (_closest(CubicBezier(other.start, q1, q2, q3).eval($0)), $0) }.compactMap(split_check).sorted { $0.0 }
                }
            }
        case let .cubic(p1, p2, p3):
            switch other.segment {
            case let .line(q1):
                if let t = CubicBezier(start, p1, p2, p3).intersect(LineSegment(other.start, q1), in: -0.5...1.5) {
                    result = t.map { ($0, other._closest(CubicBezier(start, p1, p2, p3).eval($0))) }.compactMap(split_check).sorted { $0.0 }
                }
            case let .quad(q1, q2):
                if let t = CubicBezier(start, p1, p2, p3).intersect(QuadBezier(other.start, q1, q2), in: -0.5...1.5) {
                    result = t.map { ($0, other._closest(CubicBezier(start, p1, p2, p3).eval($0))) }.compactMap(split_check).sorted { $0.0 }
                }
            case let .cubic(q1, q2, q3):
                if let t = CubicBezier(start, p1, p2, p3).intersect(CubicBezier(other.start, q1, q2, q3), in: -0.5...1.5) {
                    result = t.map { ($0, other._closest(CubicBezier(start, p1, p2, p3).eval($0))) }.compactMap(split_check).sorted { $0.0 }
                }
            }
        }

    }
    
    @inlinable
    func __closest(_ p: Point) -> Double? {
        switch self.segment {
        case let .line(p1): return LineSegment(start, p1).closest(p, in: -0.5...1.5).first
        case let .quad(p1, p2): return QuadBezier(start, p1, p2).closest(p, in: -0.5...1.5).first
