Diagonal force of object on ramp: incorrect ratios? Given $\vec{F}$, $m$, and $\theta$: how can I determine what $\vec{H}$ is?
Note: $\vec{F}$ has only an $x$ component (applied horizontally)

Here is what I've tried:

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:

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?
 A: Your error in the first case is you have not projected force vector onto path, you have projected path onto force vector.
One always projects force into path of travel not vice versa. A force however big in magnitude does no work if applied perpendicular to the path, hence the greater the difference between the force direction and path direction, the smaller is it's effect.
An intuitive double check is when the force gets divided into two components, one parallel and one perpendicular to the path, the component acting along the path is always smaller than the force. But when you devide the force by the cos of an angle you get a bigger quantity, so you have to know immediately that something is not right.
A: $\vec{H}$ is the projection of $\vec{F}$ along the incline. As a heuristic argument, ask yourself how could one component of $\vec{F}$ be larger than $\vec{F}$ itself? Recall that the magnitude of a vector is found by the pythagorean theorem. In this case, $F^2=F^2_{||}+F^2_\perp$, where $F_{||}$ and $F_\perp$ are the components of $\vec{F}$ along and perpendicular to the incline.
A: In the first case,a right angle triangle isn't formed.For example you cannot construct a right angle triangle with sides of length 4,5,6 as Pythagoras theorem isn't satisfied.You will have to shorten one side or make other long such that they satisfy Pythagoras theorem.
For more clarity,solve by another more systematic method.Take a reference set of coordinate axes X and y along H vector and perpendicular to it,along normal reaction.Resolve all these forces and then equate them. 
