0

So I've got parametric ellipse equasion like in this post: What is the parametric equation of a rotated Ellipse (given the angle of rotation)

$$x(\alpha) = R_x \cos(\alpha) \cos(\theta) - R_y \sin(\alpha) \sin(\theta) + C_x \\ y(\alpha) = R_x \cos(\alpha) \sin(\theta) + R_y \sin(\alpha) \cos(\theta) + C_y$$

My question is how to find all $\alpha$ values for which ellipse intersects given vertical or horizontal line, e.g. $x=1$ or $y=2$.?

1 Answers1

0

You’ve got an equation of the form $A\cos\alpha+B\sin\alpha = C$, so you could solve it directly, getting an unpleasant-looking expression involving $\arcsin$ and $\arctan$. However, you can take advantage of the fact that you’re working with a scaled and translated ellipse for a potentially simpler solution.

The parameterization that you’ve got in your question can be viewed as the unit circle $(\cos\alpha,\sin\alpha)$ scaled, rotated and translated. So, if you undo this transformation, the problem is reduced to finding the intersection of a line with the unit circle. Specifically, the line $x=h$ back-maps to $(R_x\cos\theta)x-(R_y\sin\theta)y+C_x=h$, while the line $y=k$ back-maps to $(R_x\sin\theta)x+(R_y\cos\theta)y+C_y=k$.

amd
  • 53,693
  • thanks @amd, that trick with transformation is great :D – tak_se_paczam Jul 27 '19 at 11:39
  • For sake of finding my mistakes: I've tried to solve it with $Acos\alpha - Bsin\alpha = C$ before and it gives me no result, or a single result, but there's two results also possible, so I wonder where I got wrong. I've tried it as follows: $$A=R_xcos\alpha \ B=R_ysin\alpha \ C=x(\alpha)-C_x$$ so knowing that $A cos\alpha - B sin\alpha\equiv Rsin(\alpha-\gamma)$ thing I've got $\alpha=arcsin(\frac{C}{\sqrt{A^2+B^2}})+arctan\frac{B}{A}$ but I've stuck here. – tak_se_paczam Jul 27 '19 at 12:07
  • @tak_se_paczam You have to consider both solutions of $R^2=A^2+B^2$. Also, I believe that you meant to write $A=R_x\cos\theta$ and $B=R_y\sin\theta$ in your comment. – amd Jul 27 '19 at 22:01
  • thanks for your help :) – tak_se_paczam Jul 27 '19 at 23:04