The given equation of the curve is:
\[
x^2 + y^2 - 10x - 14y - 51 = 0
\]
Rewriting in standard circle form by completing the square:
\[
(x^2 - 10x) + (y^2 - 14y) = 51
\]
Completing the squares yields:
\[
(x - 5)^2 - 25 + (y - 7)^2 - 49 = 51
\]
\[
(x - 5)^2 + (y - 7)^2 = 5\sqrt{5}^2
\]
The center is \( C(5,7) \) and the radius is \( r = 5\sqrt{5} \).
The distance from point \( (-7,2) \) to the center \( C(5,7) \) is calculated as:
\[
PC = \sqrt{(5 + 7)^2 + (7 - 2)^2}
\]
\[
PC = \sqrt{12^2 + 5^2} = \sqrt{144 + 25} = \sqrt{169} = 13
\]
The farthest and closest distances are:
\[
p = 13 + 5\sqrt{5}, \quad q = 13 - 5\sqrt{5}
\]
The geometric mean is:
\[
\sqrt{pq} = \sqrt{(13 - 5\sqrt{5}) (13 + 5\sqrt{5})}
\]
Applying the identity \( (a - b)(a + b) = a^2 - b^2 \):
\[
\sqrt{169 - 125} = \sqrt{44} = 2\sqrt{11}
\]