Back to project page pong-android.
The source code is released under:
MIT License
If you think the Android project pong-android listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package me.zamecnik.android.pong; // w w w. j av a 2 s . c om public class ScalarExpSmoother { double data; double currentWeight; double previousWeight; public ScalarExpSmoother(double currentWeight) { this.currentWeight = currentWeight; previousWeight = 1 - currentWeight; } public double smooth(double currentFrame) { data = previousWeight * data + currentWeight * currentFrame; return data; } }