# Maximization of angle between two 3D vectors

A homework problem requires me to maximize the angle between two vectors. Let me stress that I am looking for hints on solving this problem, not an actual detailed solution: I want to find the solution myself.

Let $\vec H$ and $\vec \omega$ be two vectors defined in the frame $B:\{\vec b_1, \vec b_2, \vec b_3\}$. No additional information is given on $\vec \omega$. The magnitude of $\vec H$, i.e. $|\vec H|$, is constant. It is known that $\theta \in [0; \pi/2[$ (solution is supposed to be around 19 degrees). Let $I_2$ be an arbitrary (and unspecified) strictly positive real number. $$\vec \omega = (\omega_i)_{i=1,2,3}^T, \forall \omega_i \in \mathbb R$$ $$\vec H = (H_i)_{i=1,2,3}^T = (2I_2\omega_1, I_2\omega_2, I_2\omega_3)^T$$

Given the definition of $\vec H$, I quickly see that $\omega_2^2$ and $\omega_3^2$ always appear together as a sum when computing the dot product and the product of the norms of both vectors. In fact, $H^2=I_2^2(4\omega_1^2 + \omega_2^2 + \omega_3^2)$, $\vec H \cdot \vec \omega = I_2(2\omega_1^2 + \omega_2^2 + \omega_3^2)$, and $\omega^2 = \sum_{i=1}^3 \omega_1^2 + \omega_2^2 + \omega_3^2$.

Using $z^2=\omega_2^2 + \omega_3^2$, and $\vec H \cdot \vec \omega = |\vec H||\vec \omega|\cos \theta$, I get the following oddity:

$$\cos \theta = \frac{2\omega_1^2 + z^2}{\sqrt{(4\omega_1^2+z^2)(\omega_1^2+z^2)}}$$

One of the problem statements is that $\theta \neq \frac{\pi}{2}$. As I am trying to maximize the angle, I want to minimize the $\cos \theta$, which in turn means I want to maximize the denominator. Until this point, everything seems correct to me.

Here are the two problems I encounter:

1. Even if I minimize the whole cosine expression, I do not have any values, so how can I actually get a numerical value for $\theta$ (which is what is expected)?
2. I try to solve the partial derivatives about $z$ and $\omega_1$ equal to zero for the denominator. However, this leads me to find complex numbers for the $\omega_i$s, which is absurd. More precisely, I find $\omega_1=\pm i\omega_2$ and $z = \pm \omega_1 \sqrt\frac{-5}{2}$. How should I go about solving this?
• What is meant by $I_2$? – charlestoncrabb Mar 19 '16 at 3:54
• It's an arbitrary real number. Let me clarify the question. – ChrisR Mar 19 '16 at 3:55
• Is there anything else missing? If $\omega=(1,0,0)$ and $I_2=-1$ then $H=(-2,0,0)$, and $\theta=\pi$. – charlestoncrabb Mar 19 '16 at 4:36
• @charlestoncrabb, I just reread the problem statement to check. The only information I had forgot to specify is that the magnitude of H is constant, but I don't really see how that helps anything. There is no assumption on the values of neither of the components of $\omega$ nor of $I_2$. – ChrisR Mar 19 '16 at 4:41
• Well it sounds like the question is rather oddly-posed, and since you can choose $\omega, I_2$ so that $\theta=\pi$, it seems you have your answer. – charlestoncrabb Mar 19 '16 at 4:53

It seems to be like a angular momentum problem $\vec{H} = [I] \vec{\omega}$. Since the x-axis seems different from the other two, why not use spherical coordinates for the components of $\vec\omega$.

$$\vec{\omega} = \omega \begin{pmatrix} \cos \psi & \sin \psi \cos\varphi & \sin \psi \sin \varphi \end{pmatrix}^\top$$

This makes

$$\vec{H} = I_2 \omega \begin{pmatrix} 2 \cos \psi & \sin \psi \cos\varphi & \sin \psi \sin \varphi \end{pmatrix}^\top$$

From the sin and cos rules you have

$$\tan\theta = \frac{ \sin\theta } {\cos \theta} = \frac{ \| \vec{H} \times \vec{\omega} \|}{ \vec{H} \cdot \vec{\omega} } = \frac{\sin\psi \cos\psi}{1+\cos^2\psi}$$

Now find $\psi$ To maximize the angle $\theta$.

The $\psi$ I found is <1

In the end, plug the expression for $\psi$ in $\vec{\omega}$ to find the direction of maximum angular momentum.