Why Q is a measure of how sharply a resonant circuit selects frequencies, and it is defined as Q = f0 / BW, where BW is the width of the response between the half-power (-3 dB) points. So if you sweep the circuit and measure how wide the response is at those points, you can compute Q directly. A narrow response means high Q; a broad one means the circuit is heavily loaded or lossy.
Watch out The resonant frequency alone tells you nothing about Q, since two circuits can resonate at the same frequency with wildly different bandwidths; you need both f0 and BW. And at resonance the inductive and capacitive reactances are equal by definition, so their ratio is always 1.
Q = f0 / BW. Narrow skirt equals high Q. Resonant frequency alone is only half the equation.