Пример #1
0
        /// <summary>
        /// Adds the constraint.
        /// </summary>
        /// <param name="A">
        /// The A.
        /// </param>
        /// <param name="B">
        /// The B.
        /// </param>
        /// <param name="relax">
        /// The relax.
        /// </param>
        public void AddConstraint(int A, int B, double relax)
        {
            var c = new DistanceConstraint(A, B);

            c.Restlength       = (this.Positions[A] - this.Positions[B]).Length;
            c.RelaxationFactor = relax;
            c.Iterations       = this.Iterations;
            this.Constraints.Add(c);
        }
Пример #2
0
 /// <summary>
 /// Adds the constraint.
 /// </summary>
 /// <param name="A">
 /// The A.
 /// </param>
 /// <param name="B">
 /// The B.
 /// </param>
 /// <param name="relax">
 /// The relax.
 /// </param>
 public void AddConstraint(int A, int B, double relax)
 {
     var c = new DistanceConstraint(A, B);
     c.Restlength = (this.Positions[A] - this.Positions[B]).Length;
     c.RelaxationFactor = relax;
     c.Iterations = this.Iterations;
     this.Constraints.Add(c);
 }