def method_36(self, bool_0): polylines = [] point3d5 = self.parametersPanel.pnlWaypoint.Point3d value = float(self.parametersPanel.txtTrack.Value) value1 = float(self.parametersPanel.txtRnpValue.text()) speed = Speed(float(self.parametersPanel.txtIas.text())) altitude = Altitude(float(self.parametersPanel.txtAltitude.text()), AltitudeUnits.FT) num1 = float(self.parametersPanel.txtIsa.text()) value2 = float(self.parametersPanel.txtTime.text()) speed1 = Speed(float(self.parametersPanel.pnlWind.speedBox.text())) num = 15 if (altitude.Feet >= 24500) else 23 speed2 = Speed.smethod_0(speed, num1, altitude) metresPerSecond = value2 * 60 * speed2.MetresPerSecond num2 = math.pow(speed2.Knots + speed1.Knots, 2) / ( 34313 * math.tan(Unit.ConvertDegToRad(num))) * 1852 num3 = value1 * 1852 num4 = num2 * (1 - math.sin(Unit.ConvertDegToRad(20))) / ( 2 * math.cos(Unit.ConvertDegToRad(20))) num5 = value1 * 1852 + 3704 if (num5 < 9260): num5 = 9260 point3d4 = MathHelper.distanceBearingPoint( point3d5, Unit.ConvertDegToRad(value + 90), num2 / 2) if (self.parametersPanel.cmbOrientation.currentText() != OrientationType.Left) else MathHelper.distanceBearingPoint( point3d5, Unit.ConvertDegToRad(value - 90), num2 / 2) point3d6 = MathHelper.distanceBearingPoint(point3d4, Unit.ConvertDegToRad(value), num4) point3d7 = MathHelper.distanceBearingPoint( point3d4, Unit.ConvertDegToRad(value + 180), metresPerSecond) num6 = num2 / 2 + 1.414 * num3 num7 = num2 / 2 + num3 point3d8 = MathHelper.distanceBearingPoint(point3d6, Unit.ConvertDegToRad(value), num6) point3d9 = MathHelper.distanceBearingPoint( point3d6, Unit.ConvertDegToRad(value + 90) - math.acos(num7 / num6), num6) point3d10 = MathHelper.distanceBearingPoint( point3d7, Unit.ConvertDegToRad(value + 90) + math.acos(num7 / num6), num6) point3d11 = MathHelper.distanceBearingPoint( point3d7, Unit.ConvertDegToRad(value + 180), num6) point3d12 = MathHelper.distanceBearingPoint( point3d7, Unit.ConvertDegToRad(value - 90) - math.acos(num7 / num6), num6) point3d13 = MathHelper.distanceBearingPoint( point3d6, Unit.ConvertDegToRad(value - 90) + math.acos(num7 / num6), num6) point3d = MathHelper.getIntersectionPoint( point3d9, MathHelper.distanceBearingPoint( point3d9, MathHelper.getBearing(point3d6, point3d9) - Unit.ConvertDegToRad(90), 100), point3d8, MathHelper.distanceBearingPoint(point3d8, Unit.ConvertDegToRad(value + 90), 100)) point3d1 = MathHelper.getIntersectionPoint( point3d10, MathHelper.distanceBearingPoint( point3d10, MathHelper.getBearing(point3d7, point3d10) + Unit.ConvertDegToRad(90), 100), point3d11, MathHelper.distanceBearingPoint(point3d11, Unit.ConvertDegToRad(value + 90), 100)) point3d2 = MathHelper.getIntersectionPoint( point3d12, MathHelper.distanceBearingPoint( point3d12, MathHelper.getBearing(point3d7, point3d12) - Unit.ConvertDegToRad(90), 100), point3d11, MathHelper.distanceBearingPoint(point3d11, Unit.ConvertDegToRad(value - 90), 100)) point3d3 = MathHelper.getIntersectionPoint( point3d13, MathHelper.distanceBearingPoint( point3d13, MathHelper.getBearing(point3d6, point3d13) + Unit.ConvertDegToRad(90), 100), point3d8, MathHelper.distanceBearingPoint(point3d8, Unit.ConvertDegToRad(value - 90), 100)) polylines1 = [] if (bool_0): num8 = num2 / 2 point3d14 = MathHelper.distanceBearingPoint( point3d4, Unit.ConvertDegToRad(value + 90), num8) point3d15 = MathHelper.distanceBearingPoint( point3d7, Unit.ConvertDegToRad(value + 90), num8) point3d16 = MathHelper.distanceBearingPoint( point3d7, Unit.ConvertDegToRad(value - 90), num8) point3d17 = MathHelper.distanceBearingPoint( point3d4, Unit.ConvertDegToRad(value - 90), num8) point3dArray = [point3d14, point3d15, point3d16, point3d17] polylineArea = PolylineArea(point3dArray) polylineArea.method_19( 1, -1 ) #MathHelper.smethod_57(TurnDirection.Right, point3d15, point3d16, point3d7)) polylineArea.method_19( 3, -1 ) #MathHelper.smethod_57(TurnDirection.Right, point3d17, point3d14, point3d4)) polylines1.append(polylineArea) point3dArray1 = [point3d9, point3d10, point3d12, point3d13] polylineArea1 = PolylineArea(point3dArray1) # for point3d0 in point3dArray1: # polyline1.Add(point3d0) polylineArea1.method_19( 1, MathHelper.smethod_57(TurnDirection.Right, point3d10, point3d12, point3d7)) polylineArea1.method_19( 3, MathHelper.smethod_57(TurnDirection.Right, point3d13, point3d9, point3d6)) # polylineArea1.set_closed(True) # polyline1.SetDatabaseDefaults(); polylines1.append(polylineArea1) num9 = num5 / 5 for i in range(1, 6): # polylineArea1.pop(len(polylineArea1) -1) polylineArea0 = polylineArea1.getOffsetCurve(num9 * i, 4) polylines1.append(polylineArea0) return polylines1
def method_36(self, bool_0): # Point3d point3d; # Point3d point3d1; # Point3d point3d2; # Point3d point3d3; # Point3d point3d4; # double num; polylines = [] point3d5 = self.parametersPanel.pnlWaypoint.Point3d value = float(self.parametersPanel.txtTrack.text()) value1 = float(self.parametersPanel.txtRnpValue.text()) speed = Speed(float(self.parametersPanel.txtIas.text())) altitude = Altitude(float(self.parametersPanel.txtAltitude.text()), AltitudeUnits.FT) num1 = float(self.parametersPanel.txtIsa.text()) value2 = float(self.parametersPanel.txtTime.text()) speed1 = Speed(float(self.parametersPanel.pnlWind.speedBox.text())) num = 15 if (altitude.Feet >= 24500) else 23 speed2 = Speed.smethod_0(speed, num1, altitude) metresPerSecond = value2 * 60 * speed2.MetresPerSecond num2 = math.pow(speed2.Knots + speed1.Knots, 2) / ( 34313 * math.tan(Unit.ConvertDegToRad(num))) * 1852 num3 = value1 * 1852 num4 = num2 * (1 - math.sin(Unit.ConvertDegToRad(20))) / ( 2 * math.cos(Unit.ConvertDegToRad(20))) num5 = value1 * 1852 + 3704 if (num5 < 9260): num5 = 9260 point3d4 = MathHelper.distanceBearingPoint( point3d5, Unit.ConvertDegToRad(value + 90), num2 / 2) if (self.parametersPanel.cmbOrientation.currentText() != OrientationType.Left) else MathHelper.distanceBearingPoint( point3d5, Unit.ConvertDegToRad(value - 90), num2 / 2) point3d6 = MathHelper.distanceBearingPoint(point3d4, Unit.ConvertDegToRad(value), num4) point3d7 = MathHelper.distanceBearingPoint( point3d4, Unit.ConvertDegToRad(value + 180), metresPerSecond) num6 = num2 / 2 + 1.414 * num3 num7 = num2 / 2 + num3 point3d8 = MathHelper.distanceBearingPoint(point3d6, Unit.ConvertDegToRad(value), num6) point3d9 = MathHelper.distanceBearingPoint( point3d6, Unit.ConvertDegToRad(value + 90) - math.acos(num7 / num6), num6) point3d10 = MathHelper.distanceBearingPoint( point3d7, Unit.ConvertDegToRad(value + 90) + math.acos(num7 / num6), num6) point3d11 = MathHelper.distanceBearingPoint( point3d7, Unit.ConvertDegToRad(value + 180), num6) point3d12 = MathHelper.distanceBearingPoint( point3d7, Unit.ConvertDegToRad(value - 90) - math.acos(num7 / num6), num6) point3d13 = MathHelper.distanceBearingPoint( point3d6, Unit.ConvertDegToRad(value - 90) + math.acos(num7 / num6), num6) point3d = MathHelper.getIntersectionPoint( point3d9, MathHelper.distanceBearingPoint( point3d9, MathHelper.getBearing(point3d6, point3d9) - Unit.ConvertDegToRad(90), 100), point3d8, MathHelper.distanceBearingPoint(point3d8, Unit.ConvertDegToRad(value + 90), 100)) point3d1 = MathHelper.getIntersectionPoint( point3d10, MathHelper.distanceBearingPoint( point3d10, MathHelper.getBearing(point3d7, point3d10) + Unit.ConvertDegToRad(90), 100), point3d11, MathHelper.distanceBearingPoint(point3d11, Unit.ConvertDegToRad(value + 90), 100)) point3d2 = MathHelper.getIntersectionPoint( point3d12, MathHelper.distanceBearingPoint( point3d12, MathHelper.getBearing(point3d7, point3d12) - Unit.ConvertDegToRad(90), 100), point3d11, MathHelper.distanceBearingPoint(point3d11, Unit.ConvertDegToRad(value - 90), 100)) point3d3 = MathHelper.getIntersectionPoint( point3d13, MathHelper.distanceBearingPoint( point3d13, MathHelper.getBearing(point3d6, point3d13) + Unit.ConvertDegToRad(90), 100), point3d8, MathHelper.distanceBearingPoint(point3d8, Unit.ConvertDegToRad(value - 90), 100)) polylines1 = [] if (bool_0): num8 = num2 / 2 point3d14 = MathHelper.distanceBearingPoint( point3d4, Unit.ConvertDegToRad(value + 90), num8) point3d15 = MathHelper.distanceBearingPoint( point3d7, Unit.ConvertDegToRad(value + 90), num8) point3d16 = MathHelper.distanceBearingPoint( point3d7, Unit.ConvertDegToRad(value - 90), num8) point3d17 = MathHelper.distanceBearingPoint( point3d4, Unit.ConvertDegToRad(value - 90), num8) point3dArray = [point3d14, point3d15, point3d16, point3d17] polylineArea = PolylineArea(point3dArray) # for point3d0 in point3dArray: # polyline.Add(point3d0) polylineArea.method_19( 1, MathHelper.smethod_57(TurnDirection.Right, point3d15, point3d16, point3d7)) polylineArea.method_19( 3, MathHelper.smethod_57(TurnDirection.Right, point3d17, point3d14, point3d4)) # polyline.set_closed(True) # polyline.SetDatabaseDefaults() polylines1.append(polylineArea) point3dArray1 = [point3d9, point3d10, point3d12, point3d13] polylineArea1 = PolylineArea(point3dArray1) # for point3d0 in point3dArray1: # polyline1.Add(point3d0) polylineArea1.method_19( 1, MathHelper.smethod_57(TurnDirection.Right, point3d10, point3d12, point3d7)) polylineArea1.method_19( 3, MathHelper.smethod_57(TurnDirection.Right, point3d13, point3d9, point3d6)) # polylineArea1.set_closed(True) # polyline1.SetDatabaseDefaults(); polylines1.append(polylineArea1) num9 = num5 / 5 for i in range(1, 6): polylineArea0 = polylineArea1.getOffsetCurve(num9 * i) polylines1.append(polylineArea0) # try: # OffsetGapType offsetType = AcadHelper.OffsetType; # try # { # AcadHelper.OffsetType = OffsetGapType.Extend; # num9 = num5 / 5 # for i in range(4): # n = i + 1 # point3dCollection = polyline1.GetOffsetCurves(5) # polyline0 = Polyline() # for point3d0 in point3dCollection: # polyline0.Add(point3d0) # polylines1.append(polyline0) # polylines = polylines1 # } # finally # { # AcadHelper.OffsetType = offsetType; # } # } # catch # { # foreach (Polyline polyline2 in polylines1) # { # if (polyline2 == null) # { # continue; # } # polyline2.Dispose(); # } # throw; # } return polylines1