From 45c74ecea916a2912bf9c8a3b0d4362bd331b3a0 Mon Sep 17 00:00:00 2001 From: Keith OHara Date: Tue, 17 Dec 2013 14:59:31 -0800 Subject: [PATCH] springs: comment and typo --- lily/spring.cc | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/lily/spring.cc b/lily/spring.cc index 312b2ed00f..ec8240b84d 100644 --- a/lily/spring.cc +++ b/lily/spring.cc @@ -17,6 +17,23 @@ along with LilyPond. If not, see . */ +/* + Springs help chains of objects, such as the notes in a line of music, + distribute themselves evenly. + Each spring decides the length from the reference point of one object + along the line to the reference point of the next, based on a force + applied to the entire chain (see Spring::length() for details): + length = distance_ + flexibility * force + + distance_ is the ideal separation between reference points + inverse_stretch_strength_ is the flexibility when the force is stretching + inverse_compress_strength_ is the flexibility when the force is compressing + min_distance_ sets a lower limit on length + + Typically, the force applied to a list of objects ranges from about + -1 to about 1, though there are no set limits. +*/ + #include "spring.hh" Spring::Spring () @@ -69,7 +86,7 @@ Spring::operator *= (Real r) { distance_ = max (min_distance_, distance_ * r); inverse_compress_strength_ = max (0.0, distance_ - min_distance_); - inverse_stretch_strength_ *= 0.8; + inverse_stretch_strength_ *= r; update_blocking_force (); } -- 2.39.5