コード例 #1
0
ファイル: Catenary.cs プロジェクト: l1101100/CatenarySpans
 /// <summary>
 /// Find the tension needed for the catenary to pass through a specific point in space.
 /// </summary>
 /// <param name="point"></param>
 public void SetClearancePoint(Vector2 point)
 {
     if (ContainsX(point.X))
     {
         double x = point.X - StartPosition.X;
         double D = StartPosition.Y + StepY / StepX * x - point.Y;
         HorizontalTension = CatenaryCalculator.SetSagAtX(Step, weight, D, x, 1e-3);
     }
 }
コード例 #2
0
ファイル: Catenary.cs プロジェクト: l1101100/CatenarySpans
        public Catenary(ISpan span, double weight, double H)
            : base(span)
        {
            this.weight            = weight;
            this.horizontalTension = H;
            this.RelativeCenter    = CatenaryCalculator.CenterPosition(Step, this.weight, H);
            this.SpanChanged      += new EventArgs <Span> .Handler(Catenary_SpanChanged);

            this.CatenaryChanged += new EventArgs <Catenary> .Handler(Catenary_CatenaryChanged);
        }
コード例 #3
0
ファイル: Catenary.cs プロジェクト: l1101100/CatenarySpans
 /// <summary>
 /// Helper function that calculates the catenary lowest point and triggers property changed notifiers
 /// </summary>
 protected internal void CalculateCenter()
 {
     this.RelativeCenter = CatenaryCalculator.CenterPosition(Step, weight, horizontalTension);
     OnPropertyChanged(() => CenterX);
     OnPropertyChanged(() => CenterY);
 }