11 Using Bezier curves for smooth animation
This chapter covers
- The mathematical foundation of Bezier curves
- Working with cubic Bezier curves in CSS animations
- Creating custom easing functions for natural-feeling motion
As you surf the web, you occasionally come across pages that offer 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 will help you understand why certain effects create such a positive response because there's a good chance that the math behind those effects involves Bezier curves.
11.1 Introduction to Bezier curves
Before diving into CSS syntax and implementations of Bezier curves, it's crucial to understand what Bezier curves actually are and how they work mathematically. Think of a Bezier 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.