Asteroid and Comet Magnitudes – Formula

No amount of googling told me what the (generic) formula for the magnitude of a comet / minor planet / asteroid is, in terms of the H and G parameters (Absolute Magnitude and Slope Parameter). The trouble was that the formula I got elsewhere on the net used the terminology ‘n’ for the slope parameter and didn’t care to call it so.

In summary, the formula is:

m = H + 5log( d ) +2.5*G*log( r );

Where the parameters are as defined here:

It took me reading through Cartes du Ciel’s source code to find out that n == G.