Trilateration code, both expressed as sphere intersection and as an optimization problem. See https://muehe.org/posts/reverse-engineering-through-trilateration/ for details.