ESRI.ArcGIS.Client.Toolkit.DataSources.GeoRssLoader.LatitudeAtLongitude C# (CSharp) Method

LatitudeAtLongitude() private static method

private static LatitudeAtLongitude ( MapPoint p1, MapPoint p2, double lon ) : double
p1 MapPoint
p2 MapPoint
lon double
return double
        private static double LatitudeAtLongitude(MapPoint p1, MapPoint p2, double lon)
        {
            double lon1 = p1.X / 180 * Math.PI;
            double lon2 = p2.X / 180 * Math.PI;
            double lat1 = p1.Y / 180 * Math.PI;
            double lat2 = p2.Y / 180 * Math.PI;
            lon = lon / 180 * Math.PI;
            return Math.Atan((Math.Sin(lat1) * Math.Cos(lat2) * Math.Sin(lon - lon2)
             - Math.Sin(lat2) * Math.Cos(lat1) * Math.Sin(lon - lon1)) / (Math.Cos(lat1) * Math.Cos(lat2) * Math.Sin(lon1 - lon2)))
            / Math.PI * 180;
        }