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); } } }
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); }