My brother Isaac and I are proud to announce the launch of our first open-source library! It’s called bezier.dart, and you can use it to perform all manner of calculations involving Bézier curves. Visit the project page here.

Bézier curve with normal lines generated with bezier.dart

Click here for a simple web animation demonstrating just a few of the library’s API functions.

The library is heavily based on the work of @TheRealPomax. Over the years, I’ve studied his Primer on Bézier curves and his original JavaScript library (Bezier.js) to learn most of what I know today about Bézier curve math. Isaac and I found ourselves incorporating algorithms from Bezier.js into our game code so often that we finally decided to make a port of the entire library into Dart. Along the way we made a fair number of diverging design decisions and applied our own style to the code. The result is something we are proud to stand behind. We’re proud of its utility, we’re proud of its readability, and of course we’re proud of the mountain of automated tests we wrote to support it. We’re releasing the library under a BSD license, and we hope that others will use bezier.dart to draw all kinds of squiggly lines and build all kinds of innovative software.