A long closely wound helical coil is called a solenoid. Fig 3.15 shows a section of stretched out solenoid. The magnetic field due to the solenoid is vector sum of the
the magnetic fields due to current through individual turns of the solenoid. The magnetic fields associated with each single turn are almost concentric circles and hence tend to cancel between the turns. At the interior mid point, the field is strong and along the axis of the solenoid (i.e) the field is parallel to the axis. For a point such as P, the field due to the upper part of the solenoid turns tend to cancel the field due to the lower part of the solenoid turns, acting in opposite directions. Hence the field outside the solenoid is nearly zero. The direction of the magnetic field due to circular closed loops (solenoid) is given by right hand palm-rule.
The coil is held in the right hand so that the fingers point in the direction of the current in the windings. The extended thumb, points in the direction of the magnetic field.