
Actually, forget what I said about the wiggly lines. Apparently, I just made a mistake when I combined the color channels from the height mask back together into a number. Here's the correct value with a sine function applied. As you can see, there are no wiggles. The mask I used here was 1000x1000 pixels. With a larger mask I think we should be able to get pretty decent results.
-- I'm not mad at you, just Westphalian.