From 78cc849a44dfbcedf9191bf804883f10f5e0066f Mon Sep 17 00:00:00 2001 From: fred Date: Sun, 24 Mar 2002 19:56:33 +0000 Subject: [PATCH] lilypond-0.1.21 --- lily/idealspacing.cc | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lily/idealspacing.cc b/lily/idealspacing.cc index 16298be1e1..7497d3b66a 100644 --- a/lily/idealspacing.cc +++ b/lily/idealspacing.cc @@ -34,3 +34,15 @@ Idealspacing::OK() const { assert (hooke_f_ >= 0); } + +Real +Idealspacing::energy_f(Real x) const +{ + Real dx = (space_f_ - x); + + Real e = sqr(dx); + if ( dx < 0) + e *= 4; // ugh. + + return hooke_f_ * e; +} -- 2.39.5