<s>[INST] Two linear equations with three unknowns and a magnitude constraint Given $u,v,w,x,y,z$ is there a way to solve the following for $a,b,c$, assuming that there is a solution (e.g. $(u,v,w)$ and $(x,y,z)$ are not proportional):
$$\begin{aligned}
au+bv &= cw\\
ax+by &= cz\\
a^2 + b^2 &= 1
\end{aligned}$$
An equivalent problem is solving for $c$ and $\theta$:
$$\begin{aligned}
u\cos\theta + v\sin\theta &= cw\\
x\cos\theta + y\sin\theta &= cz\\
\end{aligned}$$
There must be some straightforward way to solve this, but I've got a mental block. (This is not homework; I'm trying to fit a curve to some data.)
 [/INST] The system should be digestible by a Grobner basis computation. I ran it in Mathematica V13 with respect to the monomial order $\{a, b, c\}$, with the variables $b$ and $c$ eliminated
GroebnerBasis[{a u + b v - c w, a x + b y - c z, a^2 + b^2 - 1}, {a, b, c}, {b, c}]

and obtained the following polynomial for $a$
$$a^2 w^2 x^2 - w^2 y^2 + a^2 w^2 y^2 - 2 a^2 u w x z + 2 v w y z - 
 2 a^2 v w y z + a^2 u^2 z^2 - v^2 z^2 + a^2 v^2 z^2$$
Similarly, by eliminating $a$ and $c$ we get a polynomial for $b$:
$$-w^2 x^2 + b^2 w^2 x^2 + b^2 w^2 y^2 + 2 u w x z - 2 b^2 u w x z - 
 2 b^2 v w y z - u^2 z^2 + b^2 u^2 z^2 + b^2 v^2 z^2$$
and by eliminating $a$ and $b$ we get a polynomial for $c$
$$-v^2 x^2 + c^2 w^2 x^2 + 2 u v x y - u^2 y^2 + c^2 w^2 y^2 - 
 2 c^2 u w x z - 2 c^2 v w y z + c^2 u^2 z^2 + c^2 v^2 z^2$$
</s>