Given $\vec{F}$, $m$, and $\theta$: how can I determine what $\vec{H}$ is?

Note: $\vec{F}$ has only an $x$ component (applied horizontally)  

[![Figure 1](https://i.stack.imgur.com/2MTDA.png)](https://i.stack.imgur.com/2MTDA.png)

Here is what I've tried:  

[![Figure 2](https://i.stack.imgur.com/ks8Gp.png)](https://i.stack.imgur.com/ks8Gp.png)

Which gives me the this: $\cos{\theta}=\frac{\vec{F}}{\vec{H}}$  

**Solving for $\vec{H}$:**  

$\vec{H}=\frac{\vec{F}}{\cos{\theta}}$  

However, this equation is incorrect. The ratios are false and yield a faulty answer. Why is this?

Using a different triangle setup:  

[![Figure 3](https://i.stack.imgur.com/MrjpX.png)](https://i.stack.imgur.com/MrjpX.png)  

This gives me: $\cos{\theta}=\frac{\vec{H}}{\vec{F}}$  

Solving for $\vec{H}$:  

$\vec{H}=\vec{F}\cos{\theta}$  

This is the correct equation. But why does the other result not work? It may seem obvious to some, but it doesn't quite come clear to me.

**Question**:  

Why can I not relate the vectors in the way I did above?