function y = tri_r(x,m,s)
y = min(1,(max(0,(1+(x-m) ./ s))));
