When the body travels at an angle to the direction of force applied, then the work done will be equal to the product of the displacement and the component of force in the direction of displacement.
So, work done is given by the following formula:
W = (F) (S) cos θ
Where,
(W) - Work done
(F) - Force
(S) - Displacement
(θ) - Angle between force and displacement