src/AircraftTrajectories/Models/Space3D/GeographicToMetric.cs
/// <summary>
/// Converts from Geographic units to Meters
/// </summary>
/// <param name="longitude"></param>
/// <param name="latitude"></param>
/// <returns></returns>
Converts from Geographic units to Meters
Converts from Geographic units to Meters
public Point3D ConvertToXY(double longitude, double latitude)
        {
            int referenceRdX = (int) ReferencePoint.Point.X;
            int referenceRdY = (int) ReferencePoint.Point.Y;
            double referenceWgs84Y = ReferencePoint.GeoPoint.Latitude;
            double referenceWgs84X = ReferencePoint.GeoPoint.Longitude;
            double RadiansPerDegree = Math.PI / 180;
            double Rad = (referenceWgs84Y - latitude) * RadiansPerDegree;
            double FSin = Math.Sin(Rad);
            double DegreeEqualsRadians = 0.017453292519943;
            double EarthsRadius = 6378137;
            double y = referenceRdY + (EarthsRadius / 2.0 * Math.Log((1.0 + FSin) / (1.0 - FSin)));
            double x = referenceRdX + ((referenceWgs84X - longitude) * DegreeEqualsRadians * EarthsRadius);
            return new Point3D(x, y, 0, CoordinateUnit.metric);
        }
public Point3D ConvertToXY ( double longitude , double latitude ) { int referenceRdX = ( int ) ReferencePoint . Point . X ; int referenceRdY = ( int ) ReferencePoint . Point . Y ; double referenceWgs84Y = ReferencePoint . GeoPoint . Latitude ; double referenceWgs84X = ReferencePoint . GeoPoint . Longitude ; double RadiansPerDegree = Math . PI / 180 ; double Rad = ( referenceWgs84Y - latitude ) * RadiansPerDegree ; double FSin = Math . Sin ( Rad ) ; double DegreeEqualsRadians = 0.017453292519943 ; double EarthsRadius = 6378137 ; double y = referenceRdY + ( EarthsRadius / 2.0 * Math . Log ( ( 1.0 + FSin ) / ( 1.0 - FSin ) ) ) ; double x = referenceRdX + ( ( referenceWgs84X - longitude ) * DegreeEqualsRadians * EarthsRadius ) ; return new Point3D ( x , y , 0 , CoordinateUnit . metric ) ; }
Converts from Geographic units to Meters
Converts from Geographic units to Meters
// The city "Amsterfoort" is used as reference "Rijksdriehoek" coordinate. // 155000; // 463000; // The city "Amsterfoort" is used as reference "WGS84" coordinate. // 52.15517; // 5.387206;
None
longitude
double
None
latitude
double
None