Based on the theory of differential geometry and geodesy, the second order differential equation and the first differential relationship are derived on the regional earthellipsoid in this paper.
Earth is an ellipsoid and its surface is curved, but the maps are usually drawn to the floor plan on paper. So before drawing you must spread the curved surface surface to the plane first.