docs: def V_horiz_guppy(D, L, a, h, headonly=False):
      r'''Calculates volume of a tank with guppy heads, according to [1]_.
  
      .. math::
          V_f = A_fL + \frac{2aR^2}{3}\cos^{-1}\left(1 - \frac{h}{R}\right)
          +\frac{2a}{9R}\sqrt{2Rh - h^2}(2h-3R)(h+R)
  
      .. math::
          Af = R^2\cos^{-1}\frac{R-h}{R} - (R-h)\sqrt{2Rh - h^2}
  
      Parameters
      ----------
      D : float
          Diameter of the main cylindrical section, [m]
      L : float
          Length of the main cylindrical section, [m]
      a : float
          Distance the guppy head extends on one side, [m]
      h : float
          Height, as measured up to where the fluid ends, [m]
      headonly : bool, optional
          Function returns only the volume of a single head side if True
  
      Returns
      -------
      V : float
          Volume [m^3]
  
      Examples
      --------
      Matching example from [1]_, with inputs in inches and volume in gallons.
  
      >>> V_horiz_guppy(D=108., L=156., a=42., h=36)/231.
      1931.7208029476762
  
      References
      ----------
      .. [1] Jones, D. "Calculating Tank Volume." Text. Accessed December 22, 2015.
         http://www.webcalc.com.br/blog/Tank_Volume.PDF'''
      R = 0.5*D
      Af = R*R*acos((R-h)/R) - (R-h)*(2.*R*h - h*h)**0.5
      Vf = 2.*a*R*R/3.*acos(1. - h/R) + 2.*a/9./R*(2*R*h - h**2)**0.5*(2*h - 3*R)*(h + R)
      if headonly:
          Vf = Vf/2.
      else:
          Vf += Af*L
      return Vf