WonderLand
WonderLand

Reputation: 5674

Smooth transition algorithm

I 'm looking for some way to do a smooth transition between two point.

I'm think there a couple of well known mathematical way to do this but I cannot find anything with google.

I think not linear approach make things more interesting.

Scenario
Suppose I have a value A and I want to go from value B, I want to figure out how to do this transition smoothly ...
The purpose it to implement this algorithm in a program that set the display brightness It would be nice to start slow, increase and the decrease again.

Note : the values I'm using are float with 1 decimal, for ex. 50.1, 50.2

Upvotes: 0

Views: 1367

Answers (1)

coderkevin
coderkevin

Reputation: 359

I think "easing" is the term you're looking for. This is handled in many UI platforms for you, especially on the web or flash. For smooth easing transitions, look for ones that use a sine wave. Here's a great page with mouse-over animations of different easing patterns:

http://easings.net/

Also, here's a blog post with some javascript code on how you could implement this yourself:

http://www.smashingmagazine.com/2011/10/04/quick-look-math-animations-javascript/

Good luck!

Upvotes: 2

Related Questions