Using Swift to Visualize Algorithms
summary
Builds a live UIBezierPath reimplementation in Swift playgrounds that visualizes the De Casteljau construction for a cubic Bezier and for arbitrary N control points, computes points by linear interpolation (lerp) using T in [0,1], draws intermediate line segments and the final yellow point, overlays the built-in UIBezierPath to verify exactness, animates strokeEnd to show drawing, and demonstrates the tradeoff between T increment (smoothness) and speed plus a subdivision optimization that fixes performance.
AI-written summary Β· about
chapters (10)
- 0:00Intro
- 0:55Bezier Curve
- 3:41boilerplate code
- 4:23Xcode
- 5:08Draw Bezier Parts
- 13:47Draw Lines Between
- 16:15Zip
- 17:25Interp
- 18:08Multiple Control Points
- 20:03Conclusion








