A wire carrying current I has the shape as shown in adjoining figure. Linear parts of the wire are very long and parallel to X-axis while semicircular portion of radius R is lying in Y-Z plane. Magnetic field at point O is :

Magnetic field due to segment ' 1 '
Magnetic field due to segment 2
.

at centre