コード例 #1
0
ファイル: CMAPRunway.cs プロジェクト: mmaxm/maps_vvo
        public double GetCalcTrueCourse()
        {
            //return 61.03833333;

            return(CMGeoBase.Azimut(mRunwayThreshold1.Coordinates, mRunwayThreshold2.Coordinates));
            //return CMGeoBase.Azimut_m(mRunwayThreshold2.Coordinates, mRunwayThreshold1.Coordinates);
        }
コード例 #2
0
        public static int GetZone_(PointLatLng point, double Radius, int TakeoffSurfaceDirection, PointLatLng RunwayBegin, PointLatLng RunwayEnd)
        {
            double RunwayLength = GetDistance(RunwayBegin, RunwayEnd);

            List <PointLatLng> Plane1 = new List <PointLatLng>();

            Plane1.Add(CMGeoBase.OtstupVPP(Radius, 1, RunwayBegin));
            Plane1.Add(CMGeoBase.OtstupVPP(Radius, 1, RunwayEnd));
            Plane1.Add(CMGeoBase.OtstupVPP(Radius, 3, RunwayEnd));
            Plane1.Add(CMGeoBase.OtstupVPP(Radius, 3, RunwayBegin));
            // ShowPolygonPoints(Plane1);
            if (CMGeoBase.IsPointInPolygon(Plane1, point))
            {
                return(2);
            }
            else
            {
                PointLatLng pointx    = CMGeoBase.OtstupVPP(RunwayLength / 2, TakeoffSurfaceDirection, RunwayBegin);
                PointLatLng LineBegin = CMGeoBase.OtstupVPP(Radius, 1, pointx);
                PointLatLng LineEnd   = CMGeoBase.OtstupVPP(Radius, 3, pointx);

                double dec = LineSide(point, LineBegin, LineEnd);

                if (dec <= 0)
                {
                    return(TakeoffSurfaceDirection == 2 ? 3 : 1);
                }
                else
                {
                    return(TakeoffSurfaceDirection == 2 ? 1 : 3);
                }
            }
        }
コード例 #3
0
ファイル: CMAPRunway.cs プロジェクト: mmaxm/maps_vvo
        public List <PointLatLng> PointsListO()
        {
            List <PointLatLng> mPointsList = new List <PointLatLng>();

            mPointsList.Add(CMGeoBase.OtstupVPP(Width / 2, 1, CMGeoBase.OtstupVPP(0, TransitionSurfaceDirection, RunwayBegin.Coordinates, GetCalcTrueCourse()), GetCalcTrueCourse()));
            mPointsList.Add(CMGeoBase.OtstupVPP(Width / 2, 1, CMGeoBase.OtstupVPP(0, TransitionSurfaceDirection, RunwayEnd.Coordinates, GetCalcTrueCourse()), GetCalcTrueCourse()));
            mPointsList.Add(CMGeoBase.OtstupVPP(Width / 2, 3, CMGeoBase.OtstupVPP(0, TransitionSurfaceDirection, RunwayEnd.Coordinates, GetCalcTrueCourse()), GetCalcTrueCourse()));
            mPointsList.Add(CMGeoBase.OtstupVPP(Width / 2, 3, CMGeoBase.OtstupVPP(0, TransitionSurfaceDirection, RunwayBegin.Coordinates, GetCalcTrueCourse()), GetCalcTrueCourse()));

            return(mPointsList);
        }
コード例 #4
0
        public static double LineToPointDistance_(PointLatLng point, PointLatLng RunwayBegin, PointLatLng RunwayEnd)
        {
            //поиск растояния от полосы до точки через высоту треугольника
            double a = CMGeoBase.GetDistance(RunwayEnd, point);
            double b = CMGeoBase.GetDistance(point, RunwayBegin);
            double c = CMGeoBase.GetDistance(RunwayBegin, RunwayEnd);
            double p = (a + b + c) / 2;

            double h = Math.Sqrt(p * (p - a) * (p - b) * (p - c)) * 2 / c;

            return(h);
        }
コード例 #5
0
        public static int GetZone(CMGeoPoint point, double Radius, int TakeoffSurfaceDirection, CMRunwayThreshold RunwayBegin, CMRunwayThreshold RunwayEnd)
        {
            double RunwayLength = GetDistance(RunwayBegin, RunwayEnd);



            List <PointLatLng> Plane1 = new List <PointLatLng>();

            Plane1.Add(CMGeoBase.GetCoordinate(RunwayBegin, RunwayBegin.BackTrueCourse - 90, Radius).Coordinates);
            Plane1.Add(CMGeoBase.GetCoordinate(RunwayEnd, RunwayEnd.BackTrueCourse + 90, Radius).Coordinates);
            Plane1.Add(CMGeoBase.GetCoordinate(RunwayEnd, RunwayEnd.BackTrueCourse - 90, Radius).Coordinates);
            Plane1.Add(CMGeoBase.GetCoordinate(RunwayBegin, RunwayBegin.BackTrueCourse + 90, Radius).Coordinates);

            //Plane1.Add(CMGeoBase.OtstupVPP(Radius, 1, RunwayBegin.Coordinates));
            //Plane1.Add(CMGeoBase.OtstupVPP(Radius, 1, RunwayEnd.Coordinates));
            //Plane1.Add(CMGeoBase.OtstupVPP(Radius, 3, RunwayEnd.Coordinates));
            //Plane1.Add(CMGeoBase.OtstupVPP(Radius, 3, RunwayBegin.Coordinates));

            // ShowPolygonPoints(Plane1);
            if (CMGeoBase.IsPointInPolygon(Plane1, point.Coordinates))
            {
                return(2);
            }
            else
            {
                //CMGeoPoint pointx = CMGeoBase.GetCoordinate(RunwayBegin,RunwayBegin.
                PointLatLng pointx = CMGeoBase.GetCoordinate(RunwayBegin.Coordinates, RunwayBegin.TrueCourse, RunwayLength / 2);

                PointLatLng LineBegin = CMGeoBase.GetCoordinate(pointx, RunwayBegin.TrueCourse + 90, Radius);
                PointLatLng LineEnd   = CMGeoBase.GetCoordinate(pointx, RunwayBegin.TrueCourse - 90, Radius);

                //PointLatLng pointx_ = CMGeoBase.OtstupVPP(RunwayLength / 2, TakeoffSurfaceDirection, RunwayBegin.Coordinates);
                //PointLatLng LineBegin_ = CMGeoBase.OtstupVPP(Radius, 1, pointx);
                //PointLatLng LineEnd_ = CMGeoBase.OtstupVPP(Radius, 3, pointx);

                double dec = LineSide(point.Coordinates, LineBegin, LineEnd);

                if (dec <= 0)
                {
                    return(TakeoffSurfaceDirection == 2 ? 3 : 1);
                }
                else
                {
                    return(TakeoffSurfaceDirection == 2 ? 1 : 3);
                }
            }
        }
コード例 #6
0
ファイル: CMAPRunway.cs プロジェクト: mmaxm/maps_vvo
        public List <PointLatLng> PointsList()
        {
            List <PointLatLng> mPointsList = new List <PointLatLng>();

            //mPointsList.Add(CMGeoBase.GetCoordinate(CMGeoBase.GetCoordinate(RunwayBegin.Coordinates, RunwayBegin.TrueCourse, -(InnerApproachSurface.Offset + InnerApproachSurface.Length)), APInf.CRW.RunwayBegin.TrueCourse + 90, Width / 2 + 42 / HeightAngle));


            mPointsList.Add(CMGeoBase.GetCoordinate(RunwayBegin.Coordinates, RunwayBegin.TrueCourse + 90, Width / 2));
            mPointsList.Add(CMGeoBase.GetCoordinate(RunwayEnd.Coordinates, RunwayEnd.TrueCourse - 90, Width / 2));
            mPointsList.Add(CMGeoBase.GetCoordinate(RunwayEnd.Coordinates, RunwayEnd.TrueCourse + 90, Width / 2));
            //mPointsList.Add(CMGeoBase.OtstupVPP(Width / 2, 1, CMGeoBase.OtstupVPP(0, TransitionSurfaceDirection, RunwayBegin.Coordinates, GetCalcTrueCourse()), GetCalcTrueCourse()));
            //mPointsList.Add(CMGeoBase.OtstupVPP(Width / 2, 1, CMGeoBase.OtstupVPP(0, TransitionSurfaceDirection, RunwayEnd.Coordinates, GetCalcTrueCourse()), GetCalcTrueCourse()));
            //mPointsList.Add(CMGeoBase.OtstupVPP(Width / 2, 3, CMGeoBase.OtstupVPP(0, TransitionSurfaceDirection, RunwayEnd.Coordinates, GetCalcTrueCourse()), GetCalcTrueCourse()));
            //mPointsList.Add(CMGeoBase.OtstupVPP(Width / 2, 3, CMGeoBase.OtstupVPP(0, TransitionSurfaceDirection, RunwayBegin.Coordinates, GetCalcTrueCourse()), GetCalcTrueCourse()));

            mPointsList.Add(CMGeoBase.GetCoordinate(RunwayBegin.Coordinates, RunwayBegin.TrueCourse - 90, Width / 2));
            return(mPointsList);
        }
コード例 #7
0
        public static byte ZoneChecker(PointLatLng Input, List <PointLatLng> Poligon)
        {
            byte dec = 1;
            List <PointLatLng> TempPoligon = new List <PointLatLng>(5);

            TempPoligon = TempPoligon.Concat(Poligon.GetRange(0, 2).ToList()).Concat(Poligon.GetRange(Poligon.Count - 2, 2).ToList()).ToList();
            //ShowPolygonPoints(TempPoligon);
            if (CMGeoBase.IsPointInPolygon(TempPoligon, Input))
            {
                return(dec);
            }
            else
            {
                TempPoligon.Clear();
                TempPoligon = TempPoligon.Concat(Poligon.GetRange(1, Poligon.Count - 2).ToList()).ToList();
                dec        += ZoneChecker(Input, TempPoligon);
            }

            TempPoligon.Clear();
            return(dec);
        }