private bool Equals(StabilityPointStructure other) { return(StorageStructureArea.Equals(other.StorageStructureArea) && AllowedLevelIncreaseStorage.Equals(other.AllowedLevelIncreaseStorage) && WidthFlowApertures.Equals(other.WidthFlowApertures) && InsideWaterLevel.Equals(other.InsideWaterLevel) && ThresholdHeightOpenWeir.Equals(other.ThresholdHeightOpenWeir) && CriticalOvertoppingDischarge.Equals(other.CriticalOvertoppingDischarge) && FlowWidthAtBottomProtection.Equals(other.FlowWidthAtBottomProtection) && ConstructiveStrengthLinearLoadModel.Equals(other.ConstructiveStrengthLinearLoadModel) && ConstructiveStrengthQuadraticLoadModel.Equals(other.ConstructiveStrengthQuadraticLoadModel) && BankWidth.Equals(other.BankWidth) && InsideWaterLevelFailureConstruction.Equals(other.InsideWaterLevelFailureConstruction) && EvaluationLevel.Equals(other.EvaluationLevel) && LevelCrestStructure.Equals(other.LevelCrestStructure) && VerticalDistance.Equals(other.VerticalDistance) && FailureProbabilityRepairClosure.Equals(other.FailureProbabilityRepairClosure) && FailureCollisionEnergy.Equals(other.FailureCollisionEnergy) && ShipMass.Equals(other.ShipMass) && ShipVelocity.Equals(other.ShipVelocity) && LevellingCount.Equals(other.LevellingCount) && ProbabilityCollisionSecondaryStructure.Equals(other.ProbabilityCollisionSecondaryStructure) && FlowVelocityStructureClosable.Equals(other.FlowVelocityStructureClosable) && StabilityLinearLoadModel.Equals(other.StabilityLinearLoadModel) && StabilityQuadraticLoadModel.Equals(other.StabilityQuadraticLoadModel) && AreaFlowApertures.Equals(other.AreaFlowApertures) && InflowModelType.Equals(other.InflowModelType)); }
private static void TestArcToAboveArc() { Arc arc0 = new Arc(Vector2D.Zero, 1.0f, -45.0f, -135.0f); Arc arc1 = new Arc(new Vector2D(0.0, 10.0), 1.0f, 45.0f, 135.0f); double distance = 0.0; VerticalDistance.ArcToAboveArc(arc0, arc1, ref distance); Console.WriteLine(string.Format("TestArcToAboveArc = {0}", distance)); }
private static void TestArcToAboveSegment() { Arc arc = new Arc(Vector2D.Zero, 1.0f, -45.0f, -135.0f); Segment seg = new Segment(new Vector2D(-10.0f, 10.0f), new Vector2D(10.0f, 10.0f)); double distance = 0.0; VerticalDistance.ArcToAboveSegment(arc, seg, ref distance); Console.WriteLine(string.Format("ArcToAboveSegment = {0}", distance)); }
public static bool Distance(List <PicBlockRef> blockRefList1, List <PicBlockRef> blockRefList2, DistDirection direction, out double distance) { distance = double.MaxValue; // compute needed rotation double angle = 0.0; switch (direction) { case DistDirection.HORIZONTAL_RIGHT: angle = 90.0; break; case DistDirection.HORIZONTAL_LEFT: angle = 270.0; break; case DistDirection.VERTICAL_TOP: angle = 0.0; break; case DistDirection.VERTICAL_BOTTOM: angle = 180.0; break; default: break; } List <Segment> segList1 = new List <Segment>(); foreach (PicBlockRef blockRef1 in blockRefList1) { segList1.AddRange(BlockRefToSegmentList(blockRef1, angle)); } List <Segment> segList2 = new List <Segment>(); foreach (PicBlockRef blockRef2 in blockRefList2) { segList2.AddRange(BlockRefToSegmentList(blockRef2, angle)); } // search distance between 2 BlockRef bool success = false; foreach (Segment seg1 in segList1) { foreach (Segment seg2 in segList2) { double dist = double.MaxValue; if (VerticalDistance.SegmentToAboveSegment(seg1, seg2, ref dist)) { distance = System.Math.Min(distance, dist); success = true; } } } return(success); }
private static void TestArcToAboveArcTransformed() { Transform2D transf = Transform2D.Rotation(90.0); Arc arc0 = new Arc(Vector2D.Zero, 1.0f, -45.0f, 45.0f); arc0.Transform(transf); Arc arc1 = new Arc(new Vector2D(10.0, 0.0), 1.0f, 0.0f, 360.0f); arc1.Transform(transf); double distance = 0.0; VerticalDistance.ArcToAboveArc(arc0, arc1, ref distance); Console.WriteLine(string.Format("TestArcToAboveArcTransformed = {0}", distance)); }