The needle of a compass will always lies along the magnetic field lines of the earth.
A magnetic declination at a point on the earth’s surface equal to zero implies that
the horizontal component of the earth’s magnetic field line at that specific point lies along
the line of the north-south magnetic poles.
The presence of a current-carrying wire creates an additional
magnetic field that combines with the earth’s magnetic field. Since magnetic
fields are vector quantities, therefore the magnetic field of the earth and the magnetic field of the vertical wire must be combined vectorially.
Where:
B1 = magnetic field of the earth along the x-axis = 0.45 × 10 ⁻ ⁴ T
B2 = magnetic field due to the straight vertical wire along the y-axis
We can calculate for B2 using Amperes Law:
B2 = μ₀ i / [ 2 π R ]
B2 = [ 4π × 10 ⁻ ⁷ T • m / A ] ( 36 A ) / [ 2 π (0.21 m ) ]
B2 = 5.97 × 10 ⁻ ⁵ T = 0.60 × 10 ⁻ ⁴ T
The angle can be calculated using tan function:
tan θ = y / x = B₂ / B₁ = 0.60 × 10 ⁻ ⁴ T / 0.45 × 10 ⁻ ⁴ T
tan θ = 1.326
θ = 53°
The compass needle points along the direction of 53° west of north.