I fucking love math
I JUST REALIZED i mixed up the x and y in the second cosine i thought it was because i had parentheses........ Oops