I want to calculate total distance between each points both contains lat and long, these points are stored in local database, so the scenario is I want to calculate distance fro
I'm not sure if I understand the scope of this question. Do you need to take into account the curvature of earth? Or it is just 2 random points?
If it's the first : I can show you this link as i cannot help you out:
https://www.movable-type.co.uk/scripts/latlong.html
If it is the latter:
Suppose 1 is latitude and 2 is longitude, so that a1 is latitude of point A.
Calculating 2 points in a plane is something like somethign like this:
Distance = sqrt((a1−b1)+(a2−b2))
So, to calculate for example distance from D to E is: sqrt((e1-d1) + (e2-d2))