Imagine your [clincher] tyre is a tube rather than open at the bottom.
In cross section it would therefore be a circle so tyre width is equivalent to tyre diameter.
The diameter of the 'wheel' is therefore: rim dia. + (2 x tyre dia.).
Some self-styled internet 'authorities' have it that no gear calculator worth its salt can be without a
facility to add tyre diameter to the calculation.
This is true but also flawed.
Clincher tyres are 'open' at the bottom. Unlike a tubular tyre which isn't.
If you ride 'tubs' all the time then the concept of tyre diameter isn't a problem.
If you sliced your tyre [don't] straight down to the rim the cross section would be a circle with all its geometric properties.
A clincher tyre, however, is open at the bottom so for the purpose of understanding tyre diameter you have to imagine that
it is a tubular tyre completely encasing its inner tube. We know the width of clincher tyres, e.g., 700 x 23,
and since we are assuming that the tyre is round in cross section we can use tyre width as a proxy for diameter.
For the purpose of gear calculatons we add twice the diameter (or depth) of the tyre (top and bottom) to compute
the working diameter of the wheel. And after that it's as easy as Pi.
Now, tyre diameter can only be an approximation for many reasons.
There isn't a ready answer for determining tyre diameter as affected by inflation pressure, temperature,
rider weight, rim and tyre construction, frame material, wheelbase length, etc.
There are many factors that will load a tyre and alter its diameter.
So, if tyre diameter is only an approximation then it follows that gear calculations aren't entirely accurate.
But they are accurate enough for most of us.