Accurate analytical determination of the resistance of a semiconducting layer between two coplanar electrodes