  We extend recently developed methods used for determining the electromagnetic
charge radius and $a_\mu^{\pi\pi}$ to obtain a determination of the
electromagnetic form factor of the pion, $F_\pi^V(t)$, in several significant
kinematical regions, using a parametrization-free formalism based on
analyticity and unitarity, and with the inclusion of precise inputs from both
timelike and spacelike regions. On the unitarity cut, below the first inelastic
threshold we use the precisely known phase of the form factor, known from
$\pi\pi$ elastic scattering via the Fermi-Watson theorem, and above the
inelastic threshold a conservative integral condition on the modulus. We also
use as input the experimental values of the modulus at several energies in the
elastic region, where the data from $e^+e^-\to \pi^+\pi^-$ and $\tau$ hadronic
decays are mutually consistent, as well as the most recent measurements at
spacelike momenta. The experimental uncertainties are implemented by Monte
Carlo simulations. At spacelike values $Q^2=-t>0$ near the origin, our
predictions are consistent and significantly more precise than the recent QCD
lattice calculations. The determinations at larger $Q^2$ confirm the late onset
of perturbative QCD for exclusive quantities. From the predictions of
$|F_\pi^V(t)|^2$ on the timelike axis below 0.63 GeV, we obtain the hadronic
vacuum polarization (HPV) contribution to the muon anomaly,
$a_\mu^{\pi\pi}|_{\leq 0.63\gev} = (132.97\pm 0.70)\times 10^{-10}$, using
input from both $e^+e^-$ annihilation and $\tau$ decay, and
$a_\mu^{\pi\pi}|_{\leq 0.63 \gev} = (132.91\pm 0.76)\times 10^{-10}$ using only
$e^+e^-$ input. Our determinations can be readily extended to obtain such
contributions in any interval of interest lying between $2 m_\pi$ and 0.63 GeV.
