title: Math behind Google leap second smear formula
body: <p>The formula mentioned in post <a href="http://googleblog.blogspot.in/2011/09/time-technology-and-leaping-seconds.html" rel="noreferrer">Google's Leap Second Smear Techinque</a> :Modulating “lie” over a time window w before midnight:</p>
  
  <pre><code>lie(t) = (1.0 - cos(pi * t / w)) / 2.0 
  </code></pre>
  
  <p>There is no description of the math behind this. Can someone explain why the formula works. Also can this be used for any situation where we want to synchronize time gradually over a window and avoid abrupt jumps ? </p>