I am computing some lengths and angles in a circular segment and found an interesting example in the following link on page 25:
http://www.qucosa.de/fileadmin/data/qucosa/documents/18871/Geod%C3%A4tische%20Berechnungen_2015.pdf
It is clear how to compute $h$ and $s$ but I don't understand the formula for $y$. Which theorem I have to use in order to prove this result?
Construct right triangle in the following way:
Then $h-y$ defines the value of that small line (arrow pointer show it), then using Pythagorean theorem we get: $r-(h-y)=\sqrt {MP^2-(\tfrac{s}{2}-x)^2}=\sqrt {r^2-(\tfrac{s}{2}-x)^2}$. And, finally: $$y=\sqrt {r^2-(\tfrac{s}{2}-x)^2}-r+h$$