Given a line $r$ from $a$ to $b$ and a point $c$, how can I find the point $d$ in $r$ whose distance to $c$ is minumum?
I know how to find the minimum distance between $r$ and $c$, but I'm struggling extending that equation to find $d$.
I think there must be a faster way to find $d$ than generating a sphere centered in $c$ with radius equals to the minimum distance between $r$ and $c$ and then checking the intersection point between this sphere and $r$. I'm also doing this in a programming language.
In order to find the point $d$, you can compute the gradient of the line r and find the coordinates on the line where the line carried by the gradient intersects c