In optics, the law of refraction by Snellius is widely known.
The calculation of can actually be done using geometry exclusively.
I have created this nice image using CarMetal, a geometry program. You can download the CarMetal-file brechung_regulaerundtotal.zir and play around with the angles yourself. While you change , f0r example, CarMetal maintains the introduced relationships like „… being parallel to …“ or „… goes through the intersection of … and … „. The green ray shows near total reflection which appears as soon as there’s no intersection of the vertical line with the inner circle.