This solution is accurate. I would add that we should follow the advice at the end of this topic to get the correct z values. Thank you !
... View more
Thank you for your answers! Both solutions work, Xinyi's one being more intuitive (though I had to multiply the result by 2), and Fish's one being more complicated, but accurate (and I guess it is more optimized cpu speed wise).
... View more