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.)
 A: 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$$
A: The two versions of the system of equations are equivalent, so I'll consider the second (trigonometric) version
$ u \cos \theta + v \sin \theta = c w $
$ x \cos \theta + y \sin \theta = c z $
where $u,v,w,x,y,z$ are known. To eliminate the unknown $c$, divide the two equations, then
$ \dfrac{u \cos \theta + v \sin \theta}{x \cos \theta + y \sin \theta } = \dfrac{w}{z}$
Cross multiply,
$ z u \cos \theta + z v \sin \theta = w x \cos \theta + w y \sin \theta $
which re-arranges into
$ (z u- w x) \cos \theta + ( z v - w y) \sin \theta = 0 $
From which
$ \tan \theta = \dfrac{ w x - z u }{z v - wy} $
And this gives two values for $\theta$ in $[0, 2 \pi)$.
Having obtained $\theta$, we can now go back to one of the two original equations and solve $c$.
