function slider = toSlider(base, kexp, scenter, pcenter, pmin, pmax, param)

	if ((pcenter < pmin) || (pcenter > pmax))
	    pcenter = pmax*scenter + pmin*(1-scenter);
    end

    for i=1:length(param),
        p = param(i);
        
        if (p < pcenter)
            if (base == 1)
                s = (-pmin+p)*scenter/(pcenter-pmin);
                % s = (-pmin+p)*scenter/(pcenter-pmin);
            else
                s = scenter*(log(base)*kexp-log(-(-pcenter*base^kexp+pmin+p*base^kexp-p)/(pcenter-pmin)))/log(base)/kexp;
                % s = scenter*(log(base)*kexp-log(-(-pcenter*pow(base,kexp)+pmin+p*pow(base,kexp)-p)/(pcenter-pmin)))/log(base)/kexp;
            end
        else
            if (base == 1)
                s = (pcenter-scenter*pmax-p+scenter*p)/(-pmax+pcenter);
                % s = (pcenter-scenter*pmax-p+scenter*p)/(-pmax+pcenter);
            else
                s = (kexp*log(base)*scenter+log(-(-pcenter*base^kexp+pmax+p*base^kexp-p)/(-pmax+pcenter))-log(-(-pcenter*base^kexp+pmax+p*base^kexp-p)/(-pmax+pcenter))*scenter)/log(base)/kexp;
                % s = (kexp*log(base)*scenter+log(-(-pcenter*pow(base,kexp)+pmax+p*pow(base,kexp)-p)/(-pmax+pcenter))-log(-(-pcenter*pow(base,kexp)+pmax+p*pow(base,kexp)-p)/(-pmax+pcenter))*scenter)/log(base)/kexp;
            end
        end
        slider(i) = s;
    end
