The average radius of the earth is 6.38*10^6m. Is the diameter just twice that or 12.8*10^6m. The circumference is 6.28(6.38*10^6)=40.1*10^6m

Twice that radius and the diameter you wrote (12.8*10^6m) are the same thing, rounding is the difference. If you double the radius you get 12.76*10^6m and rounding 12.76 to the nearest tenth is 12.8, thus the diameter you were confused about. The circumference, based on the radius you gave, is correct, just remember, scientific notation for it would NOT be 40.1*10^6, but 4.01*10^6.

It depends on exacly what plane you are measuring the diameter/circumference in.

The Earth's shape is usually referred to as an oblate spheroid, slightly flattened at the poles with a symmetrical equatorial bulge. The mean equatorial diameter is ~7926.77 miles and the mean polar diameter is ~7900 miles. The degree of polar flatteneing is expressed by the oblateness of the spheroid, defined as f = (equatorial radius - polar radius)/equatorial radius which is currently given as 1/298.257 or ~.00335364 in the latest Astronomical Almanac.
A great circle of longitude through the poles may be viewed as an ellipse with a major axis, 2a = 7926.77 and a minor axis, 2b = 7900. This results in the distance from the center of the ellipse to a focus of the ellipse being c = sqrt[a^2 - b^2] = 325.45 miles which, in turn, results in an ellipse eccentricity of
e = c/a = 325.45/3963.385 = .082115. The polar equation of the Earth's longitudinal great circle ellipse then becomes r = a(1 - e^2)/[1 + e(cosv) = 3963.385(1 - .082115^2)/[1 + .082115(cosv)] = 3936.661/[1 + .082115(cosv)]
where r is the radial distance from the focus to the surface in miles and cosv is the cosine of the angle between the major axis and the point of interest, measured from the end of the ellipse nearest to the reference focus. Thus, when v = 0, r becomes equal to 3637.931 miles (3963.385 - 325.45) and when v = 180º, r becomes equal to 4288.839 (3963.385 + 325.45). When v = 94.71º, r becomes equal to 3963.385, which is equal to the semi-major axis, as it should be from r(94.71º) = sqrt[b^2 + c^2].

This should give a reasonable definition of the Earth's surface anywhere along a longitudinal great circle, or great ellipse, if you wish. Actual regional Geodetic and Geocentric Coordinates data may be found in the Explanetary Supplement to the Astronomical Almanac, Edited by P. Kenneth Seidelmann of the U.S. Naval Observatory, Washington, DC, University Science Books.

To determine the diameter of a circle, you multiply its radius by 2. In this case, the average radius of the Earth is given as 6.38 * 10^6 meters. So, to find the diameter, we multiply this value by 2:

Diameter = 2 * Radius

Diameter = 2 * 6.38 * 10^6

Diameter = 12.76 * 10^6 meters

Therefore, the diameter of the Earth is approximately 12.76 * 10^6 meters, not 12.8 * 10^6 meters.

Similarly, to find the circumference of a circle, you multiply its radius by the value of π (pi), which is approximately 3.14. In this case, the radius is 6.38 * 10^6 meters. So, the circumference can be calculated as:

Circumference = 2 * π * Radius

Circumference = 2 * 3.14 * 6.38 * 10^6

Circumference ≈ 6.28 * 6.38 * 10^6

Circumference = 40.07 * 10^6 meters

Therefore, the approximated circumference of the Earth is 40.07 * 10^6 meters, which rounds to 40.1 * 10^6 meters.