title: Loop to interpolate values
body: <p>I have a game, and I want to animate some objects of UI, and I want to use some kind of smooth step in animations. How I can do that, using a for loop, or using the main update code?</p>
  
  <p>E.g. I have this code</p>
  
  <pre><code>void CGameClass::Update() {
     // doing game stuff here
  }
  </code></pre>
  
  <p>and in this part of code, I want to put the code to do these animations, like, getting the scoreboard from X and take to Y, and I don't want these code to be linear, I want to make a smooth step by these two values.</p>
  
  <p>Edit:: I found a function that make this, but as linear</p>
  
  <pre><code>float LinearInterpolate(float v1, float v2, float a)
  {
      return  v1*(1.0f - a) + v2*a;
  }
  </code></pre>
  
  <p>How turn this code to make this a sine curve ?</p>