コード例 #1
0
        public static FsLatLonQuadrilateral ForRunway(FsLatLonPoint ThresholdCentre, double HeadingTrue, double WidthInFeet, double LengthInFeet)
        {
            double        num             = Math.PI * HeadingTrue / 180.0;
            double        decimalDegrees1 = FsLatitudeSpan.FromFeet(Math.Sin(num) * WidthInFeet / 2.0).DecimalDegrees;
            FsLatitude    fsLatitude1     = new FsLatitude(ThresholdCentre.Latitude.DecimalDegrees - decimalDegrees1);
            double        Feet            = Math.Cos(num) * WidthInFeet / 2.0;
            double        decimalDegrees2 = FsLongitudeSpan.FromFeet(Feet, fsLatitude1).DecimalDegrees;
            FsLongitude   Longitude1      = new FsLongitude(ThresholdCentre.Longitude.DecimalDegrees + decimalDegrees2);
            FsLatLonPoint P1 = new FsLatLonPoint(fsLatitude1, Longitude1);

            fsLatitude1 = new FsLatitude(ThresholdCentre.Latitude.DecimalDegrees + decimalDegrees1);
            double decimalDegrees3 = FsLongitudeSpan.FromFeet(Feet, fsLatitude1).DecimalDegrees;

            Longitude1 = new FsLongitude(ThresholdCentre.Longitude.DecimalDegrees - decimalDegrees3);
            FsLatLonPoint P0 = new FsLatLonPoint(fsLatitude1, Longitude1);
            double        decimalDegrees4 = FsLatitudeSpan.FromFeet(Math.Cos(num) * LengthInFeet).DecimalDegrees;
            FsLatitude    fsLatitude2     = new FsLatitude(ThresholdCentre.Latitude.DecimalDegrees + decimalDegrees4);
            double        decimalDegrees5 = FsLongitudeSpan.FromFeet(Math.Sin(num) * LengthInFeet, fsLatitude2).DecimalDegrees;
            FsLongitude   Longitude2      = new FsLongitude(ThresholdCentre.Longitude.DecimalDegrees + decimalDegrees5);
            FsLatLonPoint fsLatLonPoint   = new FsLatLonPoint(fsLatitude2, Longitude2);

            fsLatitude1 = new FsLatitude(fsLatLonPoint.Latitude.DecimalDegrees - decimalDegrees1);
            double decimalDegrees6 = FsLongitudeSpan.FromFeet(Feet, fsLatitude1).DecimalDegrees;

            Longitude1 = new FsLongitude(fsLatLonPoint.Longitude.DecimalDegrees + decimalDegrees6);
            FsLatLonPoint P3 = new FsLatLonPoint(fsLatitude1, Longitude1);

            fsLatitude1 = new FsLatitude(fsLatLonPoint.Latitude.DecimalDegrees + decimalDegrees1);
            double decimalDegrees7 = FsLongitudeSpan.FromFeet(Feet, fsLatitude1).DecimalDegrees;

            Longitude1 = new FsLongitude(fsLatLonPoint.Longitude.DecimalDegrees - decimalDegrees7);
            FsLatLonPoint P2 = new FsLatLonPoint(fsLatitude1, Longitude1);

            return(new FsLatLonQuadrilateral(P0, P1, P2, P3));
        }
コード例 #2
0
        public double DistanceFromInFeet(FsLatLonPoint Point)
        {
            FsLongitudeSpan fsLongitudeSpan = FsLongitudeSpan.BetweenTwoLongitudes(Point.Longitude, this.lon);
            double          num             = (fsLongitudeSpan.ToFeet(this.lat) + fsLongitudeSpan.ToFeet(Point.lat)) / 2.0;
            double          feet            = new FsLatitudeSpan(Point.Latitude.DecimalDegrees - this.lat.DecimalDegrees).ToFeet();

            return(Math.Sqrt(num * num + feet * feet));
        }
コード例 #3
0
        public FsLatLonPoint OffsetByNauticalMiles(double Bearing, double Distance)
        {
            double        NauticalMiles1 = Math.Sin(Math.PI * Bearing / 180.0) * Distance;
            double        NauticalMiles2 = Math.Cos(Math.PI * Bearing / 180.0) * Distance;
            FsLatLonPoint fsLatLonPoint  = new FsLatLonPoint();

            fsLatLonPoint.lat = this.lat.Add(FsLatitudeSpan.FromNauticalMiles(NauticalMiles2));
            fsLatLonPoint.lon = this.lon.Add(FsLongitudeSpan.FromNauticalMiles(NauticalMiles1, fsLatLonPoint.lat));
            return(fsLatLonPoint);
        }
コード例 #4
0
        public FsLatLonPoint OffsetByFeet(double Bearing, double Distance)
        {
            double        Feet1         = Math.Sin(Math.PI * Bearing / 180.0) * Distance;
            double        Feet2         = Math.Cos(Math.PI * Bearing / 180.0) * Distance;
            FsLatLonPoint fsLatLonPoint = new FsLatLonPoint();

            fsLatLonPoint.lat = this.lat.Add(FsLatitudeSpan.FromFeet(Feet2));
            fsLatLonPoint.lon = this.lon.Add(FsLongitudeSpan.FromFeet(Feet1, fsLatLonPoint.lat));
            return(fsLatLonPoint);
        }
コード例 #5
0
ファイル: FsLatitudeSpan.cs プロジェクト: pedro2555/FSXWX
 public static FsLatitudeSpan FromMetres(double Metres)
 {
     return(FsLatitudeSpan.FromFeet(Metres * 3.2808));
 }
コード例 #6
0
ファイル: FsLatitudeSpan.cs プロジェクト: pedro2555/FSXWX
 public static FsLatitudeSpan FromNauticalMiles(double NauticalMiles)
 {
     return(FsLatitudeSpan.FromFeet(NauticalMiles * 6076.1155));
 }
コード例 #7
0
ファイル: FsLatitudeSpan.cs プロジェクト: pedro2555/FSXWX
 public FsLatitudeSpan(int Degrees, int Minutes, double DecimalSeconds)
 {
     this = new FsLatitudeSpan((double)Degrees + (double)Minutes / 60.0 + DecimalSeconds / 3600.0);
 }
コード例 #8
0
ファイル: FsLatitudeSpan.cs プロジェクト: pedro2555/FSXWX
 public FsLatitudeSpan(int Degrees, double DecimalMinutes)
 {
     this = new FsLatitudeSpan((double)Degrees + DecimalMinutes / 60.0);
 }
コード例 #9
0
 public FsLatitude Subtract(FsLatitudeSpan Distance)
 {
     return(new FsLatitude(this.pos - Distance.DecimalDegrees));
 }
コード例 #10
0
 public FsLatitude Add(FsLatitudeSpan Distance)
 {
     return(new FsLatitude(this.pos + Distance.DecimalDegrees));
 }