Determine the closest point(s) from a line to a parametric cubic curve where the distance is less than $L$

147 Views Asked by At

Given a parametric cubic curve in 2D space: $$\vec r(t) = \vec At^3 + \vec Bt^2 + \vec Ct + \vec D$$ and a line defined by the equation: $$px + qy + k = 0$$

I can easily determine where these two equations intersect by splitting up the cubic curve into its components and substituting them into the line equation: $$p(A_xt^3 + B_xt^2 + C_xt + D_x) + q(A_yt^3 + B_yt^2 + C_yt + D) + k = 0$$

and solving this cubic equation.

This will give me where they intersect exactly, however, I need to determine where they nearly intersect within a specified distance tolerance i.e. I need the ranges of $t$ values where the distance between the line and the parametric curve is less than $L$.

Edit: I thought I'd include this as it might make the solution easier. I don't actually need a range of $t$ values, but rather only need the $t$ value that is closest to the curve in this range of values i.e. the parameter where the curve has a tangent vector parallel to the line (I think?).

How would I accomplish this? First thing that comes to mind is the distance formula, but I'm not too sure how I'd substitute the line equation into that, and it seems like things might get "messy" quickly and that there may be a better alternative.

I also thought that (when solving the cubic equation) I could analyse allow turning points that do not cross the x-axis (indicating they are close to producing roots but aren't quite) and consider the distance away this turning point is from the x-axis. However, I'm not too sure how I would relate this distance of the equation to the distance in 2D space.

Thanks!

1

There are 1 best solutions below

1
On BEST ANSWER

Hint: given a line $L$ in the plane and distance $d$, there are two lines parallel to $L$ and at distance $d$ from it. The endpoints of your desired intervals are points where the curve crosses those lines.