Primary radar can be used to compute distance as it would be proportional to the transit time taken by a pulse of energy to travel to the object and back again. As they have azimuth, they may be also have SOME elevation resolution.
Military Primary Radar is 3D since the 1960. They beam both in azimuth as well as vertical. The altutude capturing capability is usually quite good, but it needs to be calibrated from time to time. Also it shows geographical altitude, not barometric, which in older systems could be a pain in the backside when trying to correlate own primary targets with civilian secondaries. Software changes later life was good again...