public void AddConstraint(int A, int B, double relax) { var c = new DistanceConstraint(A, B); c.Restlength = (Positions[A] - Positions[B]).Length; c.RelaxationFactor = relax; c.Iterations = Iterations; Constraints.Add(c); }