I have made a small Project to calculate the intersection Point of 4 Spheres in 3D Space. The approach is a set of geometrical calculations between Circles, Planes, Speres etc. in 3D space some of which migth be usefull for other purposes.
Basically i implemented this: https://gamedev.stackexchange.com/questions/75756/sphere-sphere-intersection-and-circle-sphere-intersection
The Project: https://github.com/flhel/geometricCalcuations
Side note: This is not how GPS Calculates the Position due too measurment errors. For GPS like purposes you could use something like the Bancroft-Algorithm.
Source: https://www.researchgate.net/publication/296816047_Mathematische_Grundlagen_fur_GPS