I have this equation, where $u,v,w,a,b,Ɵ$ are constants.
The RHS comes from the Geometric definition of the LHS
$(u,v,w)(a,b,c)=||(u,v,w)||||(a,b,c)||\cos(\theta)$
Expanding the 2-norms
$(u,v,w)(a,b,c)=\sqrt{u^2+v^2+w^2}\sqrt{a^2+b^2+c^2}\cos(\theta)$
Which becomes this by the dot product on the LHS
$ua+vb+wc=\sqrt{u^2+v^2+w^2}\sqrt{a^2+b^2+c^2}\cos(\theta)$
I'm trying to solve for $c$ in terms of all the other variables.
If I solve for $c$, I find that there is two possible values $c_1, c_2$ where $c_1=-c_2$. Also I get a giant equation for $c_1$. The problem is the numerical stability and time it takes to evaluate.
Does anyone know a good way to re-write this so it doesn't have stability issues? Or does anyone know if there is a Taylor Series I can use for this to get good accuracy?
Thanks
You could write the cross product as a matrix, and then evaluate the polynomial in C.
Take the determinate of this matrix.
You get x(vc-wb) y(wa-uc) z(ub-va).
The OP actually gives the dot product, which is different,
The thing can be solved as a quadratic, by squaring both sides, which gives something like LHS =c^2 A +c B + C = Rhs =D c^ 2 + E. You then have LHS - RHS =0, which is a straight quadratic in c.
You reduce this to Fc^2+Bc+H=0, whence $c= (B\pm\sqrt{B^2-4FH})/2F$. I am on an iPad which is openly hostile to this site.