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