Does total internal reflection happen with all types of waves, or just electromagnetic ones?
It happens with any type of wave when the fields incident on the boundary can't launch a propagating wave in the other medium. This is usually due to different propagation speeds in the different media.
Yes, one way to think about that is that the wave that is incident on the boundary has a wavelength along its direction of motion, but that translates simply into a wavelength along the direction of the boundary. You just take the cosine of the angle to the normal, and divide the wavelength by that cosine, and you get the wavelength along the boundary. You can think of this is a surface wave propagating along the boundary, with that wavelength. Since the frequency of the wave is the same everywhere, you also know that frequency, so you can take the wavelength along the boundary, multiply it by that frequency, and you have the speed of propagation of that surface wave. Now you can ask if that surface wave can be connected to a propagating wave in the medium on the other side of the boundary, and the answer is no whenever the speed of the surface wave is slower than the speed of propagation in the medium on the other side of the surface. That's because the wave inside the medium can go no faster than the surface wave it is connected to-- by tilting the wave propagation direction away from that surface, you only slow down the speed of the wave, such that it matches into the speed of the surface wave.
Excellent. Thanks Antiphon.
So if a wave is incident on a boundary at an angle, you could consider the boundary to have a wave that has a speed that is less than the wave in the medium but the frequency is the same?
Separate names with a comma.