When I add a custom omnicopter ,how do I calculate the roll pitch yaw factor

Hello everyone, when I saw the omnicopter here:
Copter: add 6DoF support by IamPete1 · Pull Request #16105 · ArduPilot/ardupilot (github.com)
I felt very magical. I also want to make my own UAV, but I don’t know how to calculate the factor in the script. the example script is here:
ardupilot/Motors_6DoF.lua at master · ArduPilot/ardupilot (github.com)
if someone can show me a calculation example, I think it will be easy to understand.