For a particle to execute $S,H,M,$ the direction of net force should be opposite to displacement.so if $\theta$ is direction of displacement it should be direction of net force as well.Now $F*x=F*{net}\cos \theta$ and $F*y=F*{net}\sin \theta$.Divide both equations.