001    package railo.runtime.img.interpolation;
002    
003    public class Quadratic implements Interpolation
004    {
005        public double f(double x) {
006            if (x < 0.0)
007                x = -x;
008            if (x < 0.5)
009                return 0.75 - x * x;
010            if (x < 1.5) {
011                x -= 1.5;
012                return 0.5 * x * x;
013            }
014            return 0.0;
015        }
016        
017        public double getSupport() {
018            return 1.5;
019        }
020    }