# Finding center and rotation angle of ellipse that contains three points

Given three points $$p_1, p_2, p_3 \in \mathbb{R}^2$$, and an ellipse with shape parameters $$(a,b)$$ (the semi-major and semi-minor), is it possible to determine, if they exist, a center $$c \in \mathbb{R}^2$$ and a rotation angle $$\theta \in [0, \pi]$$, such that the ellipse centered at $$c$$ rotated by $$\theta$$ contains $$p_1, p_2, p_3$$?

In other words, let $$E(p, \theta)=\dfrac{(p_x\cos{\theta} + p_{y}\sin{\theta})^2}{a^2} + \dfrac{(p_x\sin{\theta} -p_y\cos{\theta})^2}{b^2}$$

I want to determine $$c\in \mathbb{R}^2$$ and $$\theta \in [0, \pi]$$, such that:

$$$$E(p_1-c, \theta) = 1\\ E(p_2-c, \theta) = 1\\ E(p_3-c, \theta) = 1$$$$

• Is it clear to you that the solution for given $a$ and $b$ may be not possible? Moreover this impossibility will be rather a rule than exception. Knowing escentrity however should be enough for the construction. – user May 15 at 21:49
• One of the terms of $E(p,\theta)$ should have a negative sign to it. – Doug M May 15 at 22:28
• Yes, it is clear that there might not be any solution. What do you mean that it should be a rule? Like, I should include it in the problem statement? – danft May 15 at 23:14
• Welcome to Math.SE. I haven't solve this problem, but I'll provide some hints that may eventually be useful. In the cases where a solution exists, then you can solve it, hopefully, in a step-by-step approach: 1. Use equation for $p_1$ to isolate $c_x$. 2. Substitute $c_x$ in the equation for $p_2$ and solve it for $c_y$. 3. Substitute $c_x$ and $c_y$ in the equation for $p_3$. You will get a large equation with $\sin \theta$ and $\cos \theta$. Hopefully, you may solve that using trigonometric identities. Have you tried this approach? – Ertxiem May 16 at 1:26
• Thanks for the welcome! I tried going in that direction, but isolating $c_x$ involves solving a quadratic equation, which makes things start getting kinda messy. I tried working out the math, but couldn't isolate $c_x$ and $c_y$ as functions of $\theta$. If you can post at least whatever you have done, it would help a lot. – danft May 16 at 2:08