예제 #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 static FsLatitudeSpan BetweenTwoLatitides(FsLatitude Lat1, FsLatitude Lat2)
 {
     return(new FsLatitudeSpan(Math.Abs(Lat2.UDegrees - Lat1.UDegrees)));
 }
예제 #3
0
 public FsLatitude(int Degrees, int Minutes, double DecimalSeconds)
 {
     this = new FsLatitude((double)Degrees + (double)Minutes / 60.0 + DecimalSeconds / 3600.0);
 }
예제 #4
0
 public FsLatitude(int Degrees, double DecimalMinutes)
 {
     this = new FsLatitude((double)Degrees + DecimalMinutes / 60.0);
 }
예제 #5
0
 public FsLatitude(int FSUnits)
 {
     this = new FsLatitude((double)FSUnits * 90.0 / 10001750.0);
 }
예제 #6
0
 public FsLatitude(long FSUnits)
 {
     this = new FsLatitude((double)FSUnits * 90.0 / 4.2957189152768E+16);
 }
예제 #7
0
 public void AddTCASTarget(int ID, string ATCIdentifier, AITrafficStatus State, FsLatitude Latitude, FsLongitude Longitude, double AltitudeFeet, double HeadingDegreesTrue, short GroundSpeedKnots, short VerticalSpeedFeet, short Com1)
 {
     this.aiTCASTargets.Add(new AIPlaneInfo()
     {
         id    = ID,
         idATC = ATCIdentifier,
         lat   = (float)Latitude.DecimalDegrees,
         lon   = (float)Longitude.DecimalDegrees,
         alt   = (float)AltitudeFeet,
         hdg   = (ushort)(HeadingDegreesTrue * 360.0),
         gs    = GroundSpeedKnots,
         vs    = VerticalSpeedFeet,
         com1  = Com1,
         state = (byte)State
     });
 }
예제 #8
0
 public static FsLongitudeSpan FromNauticalMiles(double NauticalMiles, FsLatitude AtLatitude)
 {
     return(FsLongitudeSpan.FromFeet(NauticalMiles * 6076.1155, AtLatitude));
 }
예제 #9
0
 public static FsLongitudeSpan FromMetres(double Metres, FsLatitude AtLatitude)
 {
     return(FsLongitudeSpan.FromFeet(Metres * 3.2808, AtLatitude));
 }
예제 #10
0
        public static FsLongitudeSpan FromFeet(double Feet, FsLatitude AtLatitude)
        {
            double num = Math.Cos(Math.PI * AtLatitude.DecimalDegrees / 180.0) * 131479672.3 / 360.0;

            return(new FsLongitudeSpan(Feet / num));
        }
예제 #11
0
 public double ToMetres(FsLatitude AtLatitude)
 {
     return(this.ToFeet(AtLatitude) / 3.2808);
 }
예제 #12
0
 public double ToNauticalMiles(FsLatitude AtLatitude)
 {
     return(this.ToFeet(AtLatitude) / 6076.1155);
 }
예제 #13
0
 public double ToFeet(FsLatitude AtLatitude)
 {
     return(Math.Cos(Math.PI * AtLatitude.DecimalDegrees / 180.0) * 131479672.3 / 360.0 * this.span);
 }
예제 #14
0
 public FsLatLonPoint(FsLatitude Latitude, FsLongitude Longitude)
 {
     this.lon = Longitude;
     this.lat = Latitude;
 }