Here's a project I created because I'm studying this topic at school. It matches the work I did in class, which I programmed on Scratch. You just have to enter the refractive index of medium 1, medium 2, and the angle of incidence. The machine will calculate and display what it represents in reality.