Kinematics problem for motion of particle in a magnetic field