How can I find the nearest point on curve $$c = y x^s$$ from a point $(x_0,y_0)$. Where $c$ and $s$ are constants
- $s$ is between $0..1023$
- $c$ is between $350..10000$
(In fact $c$ and $s$ will be integer values)
How can I find the nearest point on curve $$c = y x^s$$ from a point $(x_0,y_0)$. Where $c$ and $s$ are constants
(In fact $c$ and $s$ will be integer values)
The distance between two sets of points in $\mathbb{R^2}$ is simply $$R=\sqrt{(x-x_0)^2+(y-y_0)^2}$$ so this is the equation you need to minimize for a given $(x_0,y_0)$. The way to do this is is to take the derivative of $x$ and set it equal to zero, i.e. $\frac{d}{dx} R=0$ and solve for $x$ (you know the expression for $y$ in terms of $x$). Try to draw the situation with vectors, that might help.
If you're still stuck after trying this, let me know in the comments below.
EDIT:
Here I've plotted the original function for some $s,c$ (orange) and the derivative of $R$ (blue) - you can see the minimizing $x$ is where the orange function is zero, which is approximately $0.760939$ (which is found with the command I wrote in the comments).