def head_from_K(K, V, g=g):
    """Calculates head loss, for a given loss coefficient,
    at a specified velocity.

    .. math::
        \\text{head} = \\frac{K V^2}{2g}

    Parameters
    ----------
    K : float
        Loss coefficient, []
    V : float
        Velocity of fluid in pipe, [m/s]
    g : float, optional
        Acceleration due to gravity, [m/s^2]

    Returns
    -------
    head : float
        Head loss, [m]

    Notes
    -----
    Loss coefficient `K` is usually the sum of several factors, including
    the friction factor.

    Examples
    --------
    >>> head_from_K(K=10, V=1.5)
    1.1471807396001694
    """
    return K * 0.5 * V * V / g
