# I hate Vector Algebra

1. Sep 7, 2004

### The_Brain

I hate Vector Algebra!!

I am having some trouble doing some vector algebra and any help or direction is greatly appreciated.

In our lecture we drew a vector C(s) = A + s(B-A) which described a line passing through points A and B and found that the vector of min. length (shortest dist. from origin to line) was given by so = [A (dot) (A-B)]/[|B-A|2. The actual problem is to plug so into C(s) to show that C(so) = (sqrt(|A|2|B|2 - (A dot B)2))/(|B-A|).

What I have so far consists of changing [A (dot) (A-B)]/[|B-A|2 to [-A (dot) (B-A)]/[|B-A|2 so I can square the (B-A) however, when I do that I do not know how to then multiply that by the dot product of A. I know that A dot (B-A) is A dot B minus A dot A (A squared) but I have no idea how to do A dot (B-A)2. Thanks for any help.

2. Sep 7, 2004

### robphy

For a vector V, the quantity V2= ( V (dot) V ) is a scalar.
Note that A (dot) ( (B-A)2 ) is not a legal operation.

3. Sep 7, 2004

### The_Brain

Sorry about my notation - I should have been more obvious about the A squared part being a scalar but thanks for telling me that A (dot) ( (B-A)2 ) is not a legal operation, now I know not to work in that direction.

4. Sep 8, 2004

### robphy

Maybe not the most elegant solution

\def\vA {\vec A} \def\vB {\vec B} \def\vC {\vec C} \begin{align*} \vC &= \vA + s(\vB-\vA)\\ C^2 &= A^2 + 2s\vA\cdot(\vB-\vA)+s^2(\vB-\vA)\cdot(\vB-\vA)\\ \end{align*}

with
$$\def\vA {\vec A} \def\vB {\vec B} \def\vC {\vec C} s_0=\frac{\vA\cdot(\vA-\vB)}{|B-A|^2}$$

\def\vA {\vec A} \def\vB {\vec B} \def\vC {\vec C} \def\vAB {(\vA\cdot\vB)} \begin{align*} C(s_0)^2 &= A^2 + 2 \left[ \frac{\vA\cdot(\vA-\vB)}{|B-A|^2}\right]\vA\cdot(\vB-\vA)+\left[ \frac{\vA\cdot(\vA-\vB)}{|B-A|^2}\right]^2(\vB-\vA)\cdot(\vB-\vA)\\ &= A^2 - 2 \left[ \frac{\vA\cdot(\vA-\vB)}{|B-A|^2}\right]\vA\cdot(\vA-\vB)+ \frac{(\vA\cdot(\vA-\vB))^2}{|B-A|^2}\\ &= A^2 - \frac{(\vA\cdot(\vA-\vB))^2}{|B-A|^2}\\ &= \frac{A^2 (\vB-\vA)\cdot(\vB-\vA)- (\vA\cdot(\vA-\vB))^2}{|B-A|^2}\\ &= \frac{A^2 (B^2-2\vAB+A^2)- (A^2-\vAB)^2}{|B-A|^2}\\ &= \frac{A^2 (B^2-2\vAB+A^2)- (A^4-2A^2\vAB +\vAB^2)}{|B-A|^2}\\ &= \frac{A^2 B^2-2A^2\vAB+A^4- A^4+2A^2\vAB -\vAB^2}{|B-A|^2}\\ &= \frac{A^2 B^2-\vAB^2}{|B-A|^2}\\ \end{align*}

5. Sep 9, 2004

### The_Brain

I think that's as elegenat as it can get. After about an hour two days ago, I finally came up with a solution that was just as long if not longer than yours. It seems as if it's just brute force is the route here. Thanks for all your help.

6. Sep 9, 2004

### robphy

If you allow yourself to use some trigonometric functions, it may have been easier to manipulate.
Note that $\vec A\cdot \vec B=AB\cos\theta$ so that $A^2B^2-(\vec A\cdot \vec B)^2=A^2B^2-A^2B^2\cos^2\theta=A^2B^2(1-\cos^2\theta)=A^2B^2\sin^2\theta$.