def spring_force_fn(spring_constant, equilibrium=0):
    """Spring force by Hooke's Law.
    
    Args:
        spring_constant: Scalar. Spring constant.
        equilibrium: Spring equilibrium. Distance at which the force is zero.

    Returns:
        force_fn: Function distance -> force magnitude.
    """
    def force_fn(distance):
        return -1. * spring_constant * (distance - equilibrium)
    return force_fn