Basically I want f(x, min, max) = $\frac{1}{x*x}$ between min and max. I'm trying to make a light whose intensity falls off with 1 over the distance squared. It seems to have the following intensity when I do $1$ over distance square:
$0 = \infty $
$1 = 1 $
$4 = \dfrac 1{16} $
$8 = \dfrac 1{64} $
But I want to have an attenuation radius so that its least intensity is at the edge of the radius (0) and 1 at the centre.
I'm having trouble with this, and I think it may be because 1 / distance square is an asymptotic curve that I'm trying to map to 0(no light) to 1(maximum light). It makes less sense the more I think about it, I'm trying to map one set of values with no limits on either end to 0 and 1.