Hey beebe.

For 5. is it meant to be f(cx,cy) = f(x,y)?

You might want to try f(x,y) = (x-y)/x * H(x-y) where H(u) = 1 if u > 0, 0 if u = 0 and -1 if u < 0.

I would recommend playing around with this H(u) function (also known as the Heaviside function) to get the behaviour you are looking for.