Is there a Taylor series for vector cross product?

736 Views Asked by At

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

2

There are 2 best solutions below

3
On

You could write the cross product as a matrix, and then evaluate the polynomial in C.

Take the determinate of this matrix.

 u   v   w
 a   b   c
 x   y   z

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.

0
On

First, this is not the "vector cross product". You are looking at the "dot product" (or "scalar product").

Next, you're just solving a quadratic...

$ua+vb+wc=\sqrt{u^2+v^2+w^2}\sqrt{a^2+b^2+c^2}\cos(\theta)$

square both sides..

$(ua+vb+wc)^2=(u^2+v^2+w^2)(a^2+b^2+c^2)\cos^2(\theta)$

expand the LHS and RHS (but not too much)...

$w^2c^2+2(ua+vb)wc+(ua+vb)^2 = (u^2+v^2+w^2)(a^2+b^2)\cos^2(\theta)+(u^2+v^2+w^2)c^2\cos^2(\theta)$

Move everything over...

$\left(w^2-(u^2+v^2+w^2)\cos^2(\theta)\right)c^2+\left(2(ua+vb)w\right)c+\left((ua+vb)^2- (u^2+v^2+w^2)(a^2+b^2)\cos^2(\theta)\right)=0$

Relabel as $Ac^2+Bc+C=0$ and use the quadratic formula...

$c = \frac{-B\pm\sqrt{B^2-4AC}}{2A}$

To improve stability you could redo this, but first normalize your known vector. That is -- replace $(u,v,w)$ with $\frac{1}{\sqrt{u^2+v^2+w^2}}(u,v,w)$. This does not change the angle between the two vectors (i.e. $\theta$ is unchanged). With this assumption your "new" $(u,v,w)$ has the property that $\sqrt{u^2+v^2+w^2}=1$. So the above discussion looks like...

$ua+vb+wc=1 \cdot \sqrt{a^2+b^2+c^2}\cos(\theta)$

square both sides..

$(ua+vb+wc)^2=(a^2+b^2+c^2)\cos^2(\theta)$

expand the LHS and RHS (but not too much)...

$w^2c^2+2(ua+vb)wc+(ua+vb)^2 = (a^2+b^2)\cos^2(\theta)+c^2\cos^2(\theta)$

Move everything over...

$\left(w^2-\cos^2(\theta)\right)c^2+\left(2(ua+vb)w\right)c+\left((ua+vb)^2-(a^2+b^2)\cos^2(\theta)\right)=0$

Relabel as $Ac^2+Bc+C=0$ and use the quadratic formula...

$c = \frac{-B\pm\sqrt{B^2-4AC}}{2A}$