Benny Code
Benny Code

Reputation: 54890

How to visualize CSS3 cubic Bézier curves?

In the specification for CSS3 transitions is written that the standard Bézier curves for the acceleration are defined as follows:

The ease function is equivalent to cubic-bezier(0.25, 0.1, 0.25, 1.0) 
The linear function is equivalent to cubic-bezier(0.0, 0.0, 1.0, 1.0)
The ease-in function is equivalent to cubic-bezier(0.42, 0, 1.0, 1.0)
The ease-out function is equivalent to cubic-bezier(0, 0, 0.58, 1.0)
The ease-in-out function is equivalent to cubic-bezier(0.42, 0, 0.58, 1.0)

How can you visualize these curves? I would like to see them (like here: http://hosted.zeh.com.br/tweener/docs/en-us/misc/transitions.html).

There are four points in the cubic-bezier function but only with a single value. But to draw the curve x and y are needed for each of them?

Upvotes: 0

Views: 1160

Answers (1)

stan423321
stan423321

Reputation: 193

As long as I get it, the CSS cubic-bezier interpolation uses two implicit points on the curve which represents the graph of the interpolation functoin, namely P0 = (0,0) and P3 = (1,1). The four numbers specified there represent the two other leading points.

For example, graph for linear interpolation is equal to Bezier curve with following leading points: P0 = (0,0) (implicit), P1 = (0,0) (first two parameters), P2 = (1,1) (last two parameters) and P3 = (1,1) (implicit).

Upvotes: 1

Related Questions