A general solution for the rectangular airfoil in supersonic flow