-Spring_description::Spring_description ()
-{
- ideal_ = 0.0;
- inverse_hooke_ = 0.0;
- block_force_ = 0.0;
-}
-
-bool
-Spring_description::is_sane () const
-{
- return (inverse_hooke_ >= 0)
- && ideal_ >= 0
- && !isinf (ideal_) && !isnan (ideal_)
- && (inverse_hooke_ == 0.0 || fabs (inverse_hooke_) > 1e-8)
- ;
-}
-
-Real
-Spring_description::length (Real f) const
-{
- return ideal_ + max (f, block_force_) * inverse_hooke_;
-}
-
-/****************************************************************/
-
-/*
- TODO: should a add penalty for widely varying spring forces (caused
- by constraints, eg.
-
-
- . =====
- . | |
- .o|o|x ##x
- .
-
- The ## forces the notes apart; we shouldn't allow the O's to touch
- this closely.
-*/
-