  Linear polarization measurements in the optical band show polarization
degrees of a few percent at late times. Recently, polarization at sub-percent
level was also detected in radio by ALMA, opening the window for
multi-wavelength polarimetry and stressing the importance of properly modeling
polarization in GRB afterglows across the EM spectrum. We introduce a numerical
tool that can calculate the polarization from relativistically moving surfaces
by discretizing them to small patches of uniform magnetic field, calculating
the polarized emission from each cell assuming synchrotron radiation and
summing it to obtain the total degree of polarization. We apply this tool to
afterglow shocks with random magnetic fields confined to the shock plane,
considering electron radiative cooling. We analyze the observed polarization
curves in several wavelengths above the cooling frequency and below the minimal
synchrotron frequency and point to the characteristic differences between them.
We present a method to constrain the jet opening angle and the viewing angle
within the context of our model. Applying it to GRB 021004 we obtain angles of
10 and 8 degrees respectively and conclude that a non-negligible component of
radial magnetic field is required to explain the 1% polarization level observed
3.5 days after the burst.
