code: def scale_to_vol(self, vol):
          
  
          f = (vol / self.vol_ball) ** (1.0 / self.n)  # linear factor
          self.expand *= f
          self.radius *= f
          self.vol_ball = vol
docs: Scale ball to encompass a target volume.