I'm using R to plot some data and I'd like to transform a distance variable with $[0,\infty)$ to a transparency parameter that accepts inputs $[0,1$]. I'd like $0$ distance to map to $1$ and increasing distances to map to decreasing numbers asymptotically approaching $0$. It's been a while since I've taken any math so the function I want might be obvious, but can anyone help me out? Bonus if you explain how the function would be scaled to alter the rate that the range approaches $0$.
Thanks!
