Fig. 1
.
The solution
in two cases: when
(solid line) and
(dashed line)