It’s now perfectly clear for me, that we are looking for AB
length (that was what I was missing because the wikipedia diagram was not exaggerated enough to see the difference with d
)
I did my trigonometry following your awesome and detailed reasoning, I post here the doodle for reference
Now that I have my mind clear about the formula, I’m going to apply it to my code, I let you know
Thank you very much Yin