chapter eleven
11 Using Bézier curves for smooth animation
This chapter covers
- The mathematical foundation of Bézier curves
- Working with cubic Bézier curves in CSS animations
- Creating custom easing functions for more natural motion
As you surf the web, you occasionally encounter pages with beautifully crafted interface transitions and other animated effects. You can’t quite put your finger on why these effects work; you only know that they somehow feel just right. This chapter explains why certain effects create such a positive response. And there is a good chance the math behind those effects involves Bézier curves.
11.1 Introduction to Bézier curves
Before diving into CSS syntax and implementations of Bézier curves, it’s crucial to understand what Bézier curves are and how they work mathematically. Think of a Bézier curve as a mathematical recipe for creating smooth, flowing lines between points. These lines can be gentle and gradual or sharp and dramatic, depending on how you configure them.