Explanation:
the volume of any pyramid is
base area × height / 3
so, since we know the base area (a square with 23 mm side length), the only trick we need to do is to get the inner height (straight up in the middle from the base area to the top of the pyramid).
because this is a regular pyramid (the top of the pyramid is right above the middle of the base area), we can use Pythagoras for right-angled triangles
c² = a² + b²
with c being the Hypotenuse (the baseline of the triangle opposite of the 90° angle) and in our case the outer height along a side area triangle (24 mm).
the legs of that right-angled triangle are half of a base area side length (remember, the top of the pyramid is right over the middle of the base area square) and the inner height to the top.
so, we have
24² = 12.5² + height²
height² = 24² - 12.5² = 576 - 156.25 = 419.75
height = 20.48780125... mm
so, the volume of the pyramid is then
23² × 20.48780125... / 3 = 3,612.682287... mm³ ≈
≈ 3,612.7 mm³