There’s a game coming out called starbase that contains its own programming language. I’m trying to make a GPS system using at least 4 reference points. In the game there are receivers and transmitters that give distances. Essentially I have 4 known points with distances to a point. I know I can use trilateration but I can’t seem to find an actual equation that I can turn into code. If anyone can help that would be great :).
You have equations like this for squared distance:
(Ax-x)^2 + (Ay-y)^2 + (Az-z)^2 = A_Dist^2 {1}
where Ax,Ay,Az are coordinates of the first receiver, unknowns x,y,z are object coordinates and A_Dist is distance from pbject to receiver A. Together with similar equations for two more recievers you have system of three equations with three unknowns. Clue to solve.