To find the diameter of Mercury based on the distance halfway around the planet, we can use the formula for the circumference of a circle, which is:
\[ C = \pi \times d \]
where \( C \) is the circumference and \( d \) is the diameter.
If the distance halfway around Mercury is 4,761 miles, that means the full circumference is:
\[ C = 2 \times 4,761 = 9,522 \text{ miles} \]
Now we can set this equal to the circumference formula:
\[ 9,522 = \pi \times d \]
To find the diameter, we can rearrange the formula:
\[ d = \frac{9,522}{\pi} \]
Using \( \pi \approx 3.14159 \):
\[ d \approx \frac{9,522}{3.14159} \approx 3,031 \text{ miles} \]
Therefore, the length of the diameter of Mercury to the nearest mile is approximately 3,031 mi.