Solving for x and y components of a vector