I have Ellipse's center-points, minor-radius and major-radius.
I can find, how to check if given point(x, y) exists in Ellipse or not.
Now, I want to find given point(x,y) exists at which angle in Ellipse.
Thanks in advance Vikram
I have Ellipse's center-points, minor-radius and major-radius.
I can find, how to check if given point(x, y) exists in Ellipse or not.
Now, I want to find given point(x,y) exists at which angle in Ellipse.
Thanks in advance Vikram
On
You should know an ellipse can be represented as $\frac{x^2}{a^2}+\frac{y^2}{b^2}=1\ (a\gt b\gt 0)$. Hence, if you are saying a given point $(x,y)$ is on the ellipse, we have the following representation : $$x=a\cos\theta, y=b\sin\theta\ \ (0\le\theta \lt 2\pi).$$
Hence, if you know $(x,y)$, then you can calculate the $\theta$, which represents the angle of the point.
I got the formula to find angle towards $x$-axis at given point $(x, y)$ in Ellipse:
$\theta = \arctan2(cx - x, cy -y)\times \frac{180^\circ}{\pi} + 90^\circ $
It gives you angle from $0^\circ$ to $270^\circ$ .
To find remaining angles from $271^\circ$ to $360^\circ$, we need to do following calculation:
If $\theta <0^\circ$ then $\theta = 360^\circ + \theta$.
Thanks :)