Precision determination of the pion form factor and calculation of the muon g − 2