I am enjoying a lot your nice prism simulation. It is really amazing! I wonder if it would be possible to create a simulation with a polygonal prism, for example with 4, 5 or even 6 faces. This would be nice, even if there would be some form restrictions.
The following simulation was created due to above request ([url=http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=37.msg5425#msg5425]Re: Prism: Reflection and refraction[/url])
You can drag the slider to change the number of faces. (N:from 3 to 32, it is similar to a circle when N=32, you will study [url=http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=1430]physics of rainbow[/url])
The intensity was calculated for s-wave.
The subroutine for p-wave is also available in the xml source.
Click [b]show all[/b] chekbox to show all the rays with equal intensity. (Maximum number of trace can be changed with right slider 3-20)
If the [b]drag mode [/b]is checked, you can drag the whole polygin.
otherwise, you can drag each corner to change the shape of the polygon (with restrictions).
You can dray the arrow to change it's location or direction (depends on where you drag).
It can be drag inside the polygon,too!
un-check the checkbox labeled "[b]check[/b]" if you want to created inward type polygon shape.
The following simulation assume the ray will not enter the polygon more than once.