The blue line is a Bezier curve that has been constrained to go through the given points. The Bezier code alone (for incorporating into your projects) is available at https://scratch.mit.edu/projects/131761413/ Check the remix tree for 3 different alternative algorithms.
https://ovpwp.wordpress.com/2008/12/17/how-to-draw-a-smooth-curve-through-a-set-of-2d-points-with-bezier-methods/ http://stackoverflow.com/questions/5443653/opengl-coordinates-from-bezier-curves