Using a derivative at the beginning and at the end point.
Gives the wavy line had with smoothie.js.
May have a math problem on the derivative for the second point.