D is the distance between the two points along a great circle of the sphere. We will use the distance formula derived from Pythagorean theorem. Please try your approach on IDE first before moving on to the solution.
Browse other questions tagged java gps coordinates distance geo or ask your own question.
Lets get started with a program. It is important for use in navigation. The haversine of the central angle which is dr is calculated by the following formula. This formula was made from Pythagoras triangle theorem.