Three-dimensional trajectory design for horizontal well based on optimal switching algorithms. (September 2015)