find Distance by latitude and longtitude
<p>I am just stuck in the strange calculation.</p>

<p>i am trying to find distance by latitude and longtitude by using this formula mentioned in this site.</p>

<p><a href="http://www.movable-type.co.uk/scripts/latlong.html" rel="nofollow">http://www.movable-type.co.uk/scripts/latlong.html</a></p>

<p>every thing is Ok there when i do it by calculator but when i started doing it by programmatically there is a diiference in result.</p>

<p>here is my part of code</p>

<pre><code>lat = Convert.ToDouble( (s3[a]));
                longt =Convert.ToDouble( (s4[a]));
                Avg_lat = pc._Latitude - lat;
                Avg_longt = pc._Longitude - longt;



            a_hold =( Math.Sin(Avg_lat / 2) * Math.Sin(Avg_lat / 2) )+ (Math.Cos(pc._Latitude) * Math.Cos(lat)) * (Math.Sin(Avg_longt / 2) * Math.Sin(Avg_longt / 2));
            c_hold = 2 * Math.Atan2(Math.Sqrt(a_hold), Math.Sqrt(1 - a_hold));
           // c_hold = (c_hold * 180) / 3.12;
            distance = 6371 * c_hold;
</code></pre>

<p>the problem is Math funcation here calculate the things in radian i want it in degree. so i just found a formula to convert radian into degree but that formula does'nt convert the calculation correctly..</p>

<p>I am just confused what to do bcoz there is'nt any other option to convert radian into degree..</p>

<p>Any suggestion or IDea would be Apprectiable . Looking for the quick Replay</p>

<p>Thanks</p>
