Figure : 1,
Database table
Vehicleid Latitude Longitude datetime
1 16.43924553090 79.92235564210 2012-12-19 16:00:00.000
1 16.43517902890 79.92466106060 2012-12-19 16:02:00.000
1 16.43111252690 79.92498125760 2012-12-19 16:04:00.000
1 16.42797459620 79.92517337580 2012-12-19 16:06:00.000
2 14.68807134570 79.50083987840 2012-12-19 17:12:00.000
2 14.68514259410 79.51420230760 2012-12-19 17:14:00.000
3 18.56690251930 82.50047999880 2012-12-19 18:22:00.000
3 18.56884750210 82.50426359800 2012-12-19 18:24:00.000
Based on above figure1 (database table), how to calculate distance between starting and ending points by using c# .net and also at the same time insert the starting( lat& long) and ending (lat & long) as well as strating time, ending time, distance values in another table like below table
Vehicleid Starting(lat & long) Ending (lat & long) Distance(in kms) Strat time End time
1 16.43924553090, 79.92235564210 16.43517902890,
79.92466106060 ? 2012-12-19 16:00:00.000 2012-12-19 16:02:00.000
1 16.43517902890,
79.92466106060 16.43111252690,
79.92498125760 ? 2012-12-19 16:02:00.000 2012-12-19 16:04:00.000
1 16.43111252690,
79.92498125760 16.42797459620,
79.92517337580 ? 2012-12-19 16:04:00.000 2012-12-19 16:06:00.000