The arc of a thrown object with the initial horizontal speed $v_x$, the initial vertical speed $v_y$ and a gravity of $\frac{625}{64}$ can be described with $$ x(t) = v_x * t \\ y(t) = v_y * t - \frac{625}{128} * t^2 $$
The difference of the point I want to know the distance and the initial position of the thrown object is $(D_x, D_y, D_z)$.
To make things easier, I work with the square of the distance since the extremes stay at the same $t$. The direction the object is thrown is set with $\alpha$.
$$ d_{square}(t) = (D_x - (t * v_x * cos(\alpha)))^2 + (D_y-y(t))^2 + (D_z - (t * v_x * -sin(\alpha)))^2 $$
Now I derivate $d_{square}(t)$ and set it to zero to find the extremes of $d_{square}(t)$. I search for the last derive's root since I expect it to be what I am looking for.
$$ d'_{square}(t) = 2*(v_x*(D_z*sin(\alpha) - D_x*cos(\alpha) + t*v_x) + (y(t) - D_y)*y'(t))\\ 0 = v_x*(D_z*sin(\alpha) - D_x*cos(\alpha) + t*v_x) + (y(t) - D_y)*y'(t)\\ y'(t) = v_y - t * \frac{625}{64} $$
Now I realize that these put together will result in an ugly cubic function I can't just find roots of without investing some time, and I am not certain how to proceed from there, but I noticed something strange when I asked Wolfram Alpha to find $t$ anyway:
$$ t_{extrema}≈0.10240 * v_y $$
The approximate roots of the derivate are pretty much always $\frac{v_y}{gravity}$ according to the site with some tiny variations in wild square and cubic roots in the exact result. This surely can't be right, all the other variables have to be significant as well here. Did I do something wrong to this point?