should be x/cos(whatever), as you're working out the hypotenuse from the adjacent.