The physics
Gauss's law links the field to the charge inside a closed surface. For a ball, pick a sphere through the probe.
E × 4πr² = qin / ε0 k = 1 / 4πε0 = 9 × 10⁹ N m²/C²
Outside an even ball, it acts like a point charge at its centre. Inside, only the charge within r counts.
outside: E = kQ / r² inside: E = kQr / R³ = ρr / 3ε0
A thin shell has no field inside. Just outside it, E = σ/ε0.
An empty hole acts like the full ball plus a small −ρ ball. So the field in the hole is steady. It points along the line of centres.
in the hole: E = ρd / 3ε0 (d: centre to centre)
If ρ changes with r, add up thin layers first: dq = ρ × 4πr² dr.