The kind of structure you have on the left is very cooperative. It is simply transformed to the even more convenient form on the left.

R = sqrt(12^2 + (-5)^2) = 13

The angle is a little trickier, but simply written.

theta = -atan(-5/12)

Then just write the answer 13*cos(x-theta)