Let $\alpha$ be the angle joining P to the centre with the positive x axis. If the line PQ is a tangent to the circle, then $a\cos\alpha+b\sin\alpha=?$
I know that parametric equation of a tangent to a circle is $$h\cos \alpha +k\sin \beta =r$$ Where h and k are coordinates of P.
How do I relate this to Q, which doesn’t lie on the circle?
The normal equation of a straight line with unit normal $(\cos\alpha,\sin\alpha)$ (as it is your case) whose distance to the origin is $r$ is $$ x\cos\alpha+y\sin\alpha=r $$ Since your point $Q(a,b)$ lies on the line, $$ a\cos\alpha+b\sin\alpha=r $$