This doesn’t seem necessary any more, because we have simulators. But interesting to see what people had to do back in the day:
Denavit-Hartenberg (DH) parameters
https://blog.robotiq.com/how-to-calculate-a-robots-forward-kinematics-in-5-easy-steps