0

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

2
  • Algorithm? Just use one of many known function, for example, exponential... Commented Mar 27, 2015 at 5:10
  • what do you mean smoothly, what intervals do you want to set? For me smooth would be just taking the euclidean distance between those 2 points, and then bumping the value by (B-A)/distance every "1" measurement step. On the other hand if you have information about other parts of the plane you could probably interpolate the values between A and B using one of many interpolation algorithms. All depends on your requirements. Another option would be to use a simple gradient. Commented Mar 27, 2015 at 5:12

1 Answer 1

2

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!

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.