public CMAPRunway(string name, double length, double width, CMRunwayThreshold runwaythreshold1, CMRunwayThreshold runwaythreshold2) { Name = name; Length = length; Width = width; mRunwayThreshold1 = runwaythreshold1; mRunwayThreshold2 = runwaythreshold2; }
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); } } }