Suppose we have a straight line in Cartesian space such that $$ x_k = x_0 + k \delta x, \quad \quad y_k = y_0 + k \delta y, \quad \quad z_k = z_0 + k \delta z $$ where $k$ can take any real value. If we project that line into cylindrical polar coords then $$ R_k = \sqrt{ x_{k}^{2} + y_{k}^{2} }. $$ Now suppose there exists some rectangle in the $(R,z)$ plane having a centre at $(R_c, z_c)$ and sides of length $L_R$ and $L_z$.
The rectangle is aligned with the $R$ and $z$ axes such that a point on the curve is inside the rectangle if $|R_c - R_k| < L_R / 2$ and $|z_c - z_k| < L_z / 2$.
Can anyone suggest an efficient way to compute whether the projection of the line onto the $(R,z)$ plane intersects the rectangle?