src/AircraftTrajectories/Models/Space3D/CoordinateConversion.cs
/// <summary>
/// Converts the coordinates of a 3D point from meters to required unit
/// </summary>
/// <param name="point"></param>
/// <param name="newUnits"></param>
/// <returns></returns>
Converts the coordinates of a 3D point from meters to required unit
Converts the coordinates of a 3D point from meters to required unit
protected Point3D ConvertMetricsTo(Point3D point, CoordinateUnit newUnits)
        {
            double newX = point.X;
            double newY = point.Y;
            double newZ = point.Z;
            switch (newUnits)
            {
                case CoordinateUnit.imperial:
                    newX = point.X / FeetToMeters;
                    newY = point.Y / FeetToMeters;
                    newZ = point.Z / FeetToMeters;
                    break;
                case CoordinateUnit.metric:
                    break;
                case CoordinateUnit.geographic:
                    var converter = new MetricToGeographic(new ReferencePointRD());
                    var geoPoint = converter.ConvertToLongLat(point.X, point.Y);
                    newX = geoPoint.Longitude;
                    newY = geoPoint.Latitude;
                    break;
            }
            return new Point3D(newX, newY, newZ, newUnits);
        }
protected Point3D ConvertMetricsTo ( Point3D point , CoordinateUnit newUnits ) { double newX = point . X ; double newY = point . Y ; double newZ = point . Z ; switch ( newUnits ) { case CoordinateUnit . imperial : newX = point . X / FeetToMeters ; newY = point . Y / FeetToMeters ; newZ = point . Z / FeetToMeters ; break ; case CoordinateUnit . metric : break ; case CoordinateUnit . geographic : var converter = new MetricToGeographic ( new ReferencePointRD ( ) ) ; var geoPoint = converter . ConvertToLongLat ( point . X , point . Y ) ; newX = geoPoint . Longitude ; newY = geoPoint . Latitude ; break ; } return new Point3D ( newX , newY , newZ , newUnits ) ; }
Converts the coordinates of a 3D point from meters to required unit
Converts the coordinates of a 3D point from meters to required unit
None
point
Point3D
None
newUnits
CoordinateUnit
None