Call the vector <x, y>. Saying it has length 26 means that . Saying that it has slope 5/12 means that x/y= 12. That gives you two equations to solve for x and y. From x/y= 12, x= 12y so the first equation becomes . You may assume that x and y are positive: if x and y are both positive or both negative, the sign disappears in both formulas. That is, if you find <x, y> which satisfies those equations, so does <-x, -y>. (I don't think it is necessary to "assume" your vectors are in - if they were not they would not have "slope".)