@jusep-sobrino As far as I can see the logic is correct. However, a lot of constants are used. What is your exact problem?