I have a vector $v$ and two non-orthogonal vectors $p$ and $q$. I'm trying to decompose $v$ in terms of $p$ and $q$, resulting in two variables $i$ and $j$ such that $i~p + j~q = v$. After trying a few different things I settled on using the law of sines as follows (with $\cdot$ being the dot product of two vectors and $||v||$ being the length of $v$):
$x = \frac{||v||}{\sin (p \cdot q)}$
$i = \frac{x ~ \sin(q \cdot v)}{||p||}$
$j = \frac{x ~ \sin(v \cdot p)}{||q||}$
Unfortunately, this only gives me the absolute value of $i$ and $j$. For example, decomposing (6,0) in (0,1) and (3,2) produces 4 and 2, whereas the correct answer is -4 and 2. Can anyone tell me how to get the correct signs for $i$ and $j$?