Solving a set of 3 Nonlinear Equations In the following 3 equations:
$$
k_1\cos^2(\theta)+k_2\sin^2(\theta) = c_1
$$
$$
2(k_2-k_1)\cos(\theta)\sin(\theta)=c_2
$$
$$
k_1\sin^2(\theta)+k_2\cos^2(\theta) = c_3
$$
$c_1$, $c_2$ and $c_3$ are given, and $k_1$, $k_2$ and $\theta$ are the unknowns. What is the best way to solve for the unknowns? Specifically, I need to solve many independent instances of this system in an algorithm. Therefore, ideally the solution method should be fast.

Add and subtract equations $1$ and $3$, giving the system
$$\begin{cases}\begin{align}k_1+k_2&=c_1+c_3\\(k_1-k_2)\sin2\theta&=-c_2\\(k_1-k_2)\cos2\theta&=c_1-c_3\end{align}\end{cases}$$
Then you find $k_1-k_2$ and $2\theta$ by a polar-to-Cartesian transform, giving
$$\begin{cases}\begin{align}k_1+k_2&=c_1+c_3,\\k_1-k_2&=\sqrt{c_2^2+(c_1-c_3)^2},\\2\theta&=\arctan_2(-c_2,c_1-c_3).\end{align}\end{cases}$$
