Man, my math skills are getting kinda dusty.

I've got a function of p (written in c)
  f = pow(p, (log 0.5)/log m)
where m is a parametric constant 0<m<1 (not 0 or 1)
and p is in 0<=p<=1.
It /can be shown/ that f is also in the range [0,1]

What does this function look like? It seems that it _shouldn't_ be that
hard, but I find my head won't seem to work.

I know what it is for some values of m:
  for m=approaching 0  f=> p**0 = 1
  for m=0.5,           f= p**1 = p
  for m=approaching 1, f= p**-BIG => 0

This is one of the blend functions available in the GIMP gradient
editor, and I'd like to understand it better. It helps to consider it
always as a gradient from black to white. The variable p being the
relative position along the blend-line, and f gives the factor applied
in calculating the resulting color. When f=p, the blend is the same as a
linear gradient. The parameter m defines the bias of the blend curve
toward the beginning(0) or end(1) of the blend-line.

- Small m makes f vary rapidly over the short distance [0,m] mapping the
output to the range f=[0,.5] (black to mid-gray), and then that is
followed by a more gradual blend over the larger range [m,1] mapping to
f=[.5,1] (mid-gray-to-white)

- Large m makes f vary slowly over the larger distance [0,m] giving
output [0,.5] and then rapidly over the shorter [m,1] mapping output
to[.5,1]

Hmmm, maybe i should just plot it? What's the easiest tool to plot an
analytical function?

Regards,
..jim


-- 
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-list

Reply via email to