A charged particle $q$ enters a uniform magnetic field $\vec{B}$ with velocity $\vec{v}$ making an angle $\theta$ with it. Since the Lorentz force is perpendicular to the velocity, the particle will move along a circular path of radius $r$, which my textbook derives as follows:
$$\frac{mv^2}{r}=qvB \sin\theta$$ $$r=\frac{mv}{qB\sin\theta}.$$
But I think the correct formula for $r$ should be derived as follows:
$$\frac{m(v\sin\theta)^2}{r}=qvB \sin\theta$$ $$r=\frac{mv\sin\theta}{qB}.$$
This should be because we only consider the perpendicular component of velocity when we calculate magnetic force and therefore the velocity to which the force is perpendicular is the component of velocity perpendicular to $\vec{B}$ and not $\vec{v}$.
Which is the correct formula?