# NTNUJAVA: Virtual Physics Laboratory: Enjoy the fun of Physics

You need a java enabled browser (click for more information)

• Prism: Reflection and refraction by:at 2004/01/29 23:03

## Prism: Reflection and refraction

This java applet let you play with a light source and a prism, to study the physics of light. There are reflection and refraction occurs at the interface between two media. (Total internal reflection might also occurs)
refractive indices: air (n1)= prism(n2)= Do not forget to hit ENTER key

Usage: Click the red region to change the light direction. Click other region of light source can move the light pen to differ location( even inside the prism). Click one of the corner of the prism to change the shape of prism. Click inside the prism to change its location. When tracing of the light will terminated when the ray intensity is less than  than 0.4%. The relative intensity for each ray is shown at the boundary. Intensity of red and green are used to represent two different polarization. The yellow light (sum of red light and green light) represent equal intensity of two polarization waves. At Brewster's angle, only one of the polarized light is refracted, and other one is totally reflected. The index of refraction for the prism is 1.5
Things to watch: 1. Total internal reflection 2. Change in light intensity 3. There might be small bugs, did you find out?
Light will travel with different speed at different media, which cause the reflection and refraction. For reflection: the angle of incidence is equal to angle of reflection. For refraction: the Snell's law govern the angle index of refraction for media 1: angle of incidence index of refraction for media 2: angle of refraction Part of the energy is reflected and the rest propagate into new media. The ratio depend on incident angle and index of refraction ( refracted angle ) EM (transverse) wave can have two polarization (perpendicular to each other and ) The intensity is proportional to The intensity of electric field changed when reflection/refraction occurs, where , So the intensity for the reflected light is proportional to Since the energy is conserved, so we can find out the intensity of refraction light. For normal incident, both and equal to zero. The coefficient are the same = For light emit from air (n=1.) into glass (n=1.5) The electric field scale to = (1.5-1)/(1.5+1)=0.2 So the intensity of the reflection scale to 0.22=0.04 ( 4% of incident light) So 96% light will enter the glass and only 4% of light were reflected. This java applet use above equations to calculate the relative intensity of each ray.

See 27 replies click

1. GREAT by:at 2004/05/05 19:56:idea: You ae very intelligent to write this.... I was wondering, can you write a JAVA Optics app that illustrates light reflection/refraction through a rond orb? Like a round marble, but be able to change one side from fully round to flat, adjustable slider (or numeric entry would suffice) Light would come through the round side of the orb (at any varying angle) and refract through it...similar to a prism, yet this is round. Also, most important....can you plug in the refractive indexed for Glass, Acrylic, and any othe polymers (or chemicals) you have the indexes of... Thanks... Hope you want to do something like this.... If you need an actual animation of what I am talking about, I can send it to you.... Thanks, Mark

2. topic37 by:at 2004/05/06 08:32It will be similar to Physics of rainbow

3. Source code by:at 2006/05/26 17:39We currently have a group project which is very similar to this, but we just totaly have no idea about it. until I found your site via google.Your applet is very inspirational and we are so enlighted! Could you share source code (*.java) of this project. We will be pleased. My e-mail: mattisse@onet.eu

4. Re: Prism: Reflection and refraction by:c00wat 2008/05/10 12:26I was wondering if I could also get the source code so it can be modified.

5. Re: Prism: Reflection and refraction by:annaceguat 2010/02/08 21:29Hi,

Would it be possible to print out other parameters, e.g. angles of the triangle & angles that the beam enters the prism please?

Thanks,
Anna.

6. Re: Prism: Reflection and refraction by:hwangat 2010/02/09 01:12It is possible to print out angles for triangles. But I do not think those information are really usefully.
The light paths depends on too many parameters.
To find the refracted light, you need to find the angle of incident $\theta_1$(angle between incident beam and the normal vector).
Then, the refracted angle $\theta_2=\frac{n_1}{n_2}\theta_1$ where $n_1,n_2$ are index of refraction for two regions.

May I know what kind of information you really want (are looking for)? or what kind of problem you want to solve?
So that I can find better way to help!

7. Re: Prism: Reflection and refraction by:annaceguat 2010/02/09 05:52Hi,
Thanks for your prompt reply! I just want to play around with different parameters such as triangle angles and incident beam angles to get the behaviour I want, then be able to see through the applet what those angles are. The n1 & n2 are already there which is good, but I would really like those angles!
Regards,
Anna.

8. Re: Prism: Reflection and refraction by:hwangat 2010/02/09 13:25I just add those angle vaues at the top-left corner.

9. Re: Prism: Reflection and refraction by:annaceguat 2010/02/09 15:28Thank you very much!

10. Re: Prism: Reflection and refraction by:liesenbergkat 2010/02/17 19:47Dear Mr. Fu-Kwun Hwang,

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.

Thanks a lot for your kind attention.

11. Re: Prism: Reflection and refraction by:hwangat 2010/02/18 11:11It is possible to create a simulation with polygon prism.
However, I would like to know what is the problem you want to solve or what is the purpose for your request?
So that I can design one better suit your need?
For example: Does all the inside angles are all equal, or it can be angle angle?
Does the side of polygon changable? Do you need the intensity for all rays to be calculated? ...

Please write down what you really want in detail?

12. Re: Prism: Reflection and refraction by:liesenbergkat 2010/02/19 05:24Hello, thanks for your fast reply!

In fact I am an optics enthusiast. With more faces I could simulate variations on consecrated designs as LITTROW, PELLIN-BROCA, BREWSTER, BAUERNFEIND, DOVE, Pentagon, Rhomboid prisms. I have been constructing some devices like telescopes and rearprojection.

Therefor the angles should be individually settable. Intensity is not a must, but would be nice (if possible).  ;)

Please let me know if you need further information.

Best regards!

13. Re: Prism: Reflection and refraction by:hwangat 2010/02/19 11:18It is done. Please check out  Ray tracing (polygon: range from 3-10 faces)

You are welcomed to check out the following similar/related applets
Dispersion of light with prism ,
Prsim optics (slow motion of light entering a prism) ,
It is fun to play with prism. (light trace and intensity due to refraction)
or Lens (thick lens) and Mirror

14. Re: Prism: Reflection and refraction by:liesenbergkat 2010/02/19 18:08Dear Professor,

Thanks a lot for you amazingly fast programming of the requested optical polygon!  :)
I am enjoying it a lot. It is very useful for my present study object. I will thoroughly test this simulation and come back to you with some suggestions. Thanks again, also for the other models you pointed out for me!

Best regards.

15. Re: Prism: Reflection and refraction by:liesenbergkat 2010/02/23 00:21Dear Professor,

I tested the polygon ray tracing for a while. It would be desireable to allow simple concave polygons (please refer to http://en.wikipedia.org/wiki/Simple_polygon). These polygons are not self intercepting but you may cross them with a line on more than two points. I know that the programming will be trickier for this case. But it would be very helpful.

Best regards!

16. Re: Prism: Reflection and refraction by:hwangat 2010/02/23 00:42Please write down in detail what you really want to do.
[quote]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.[/quote]
You were asking extendsion from prism to polygon, so I created the simulation [url=http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=1434]Ray tracing (polygon: range from 3-32 faces)[/url]
I can only guest what you might want.
You can try out Lens (thick lens) and Mirror or other similar applet if you just need simulation for concave lens.
It might be easier to add some control points to set up concave/convex lens if that is when you want to play with.

It will be much easier if you can provide all the information so that the created simulation can best fit with what you need! Waiting for your information!

17. Re: Prism: Reflection and refraction by:liesenbergkat 2010/02/23 18:47Dear Professor,

I am sorry for being clear enough in my formulation. Please observe the attached simple concave polygon as one example of the multi-face prisms I would like to investigate.

Please let me know if this can be done.

Best regards!

18. Re: Prism: Reflection and refraction by:hwangat 2010/02/23 22:34Yes. It can be done.
Because you did not provide coordinates for the polygon shape, I modified the simulation so that you can help yourself.

Please visit Ray tracing (polygon: range from 3-32 faces)

There is a form just below the simulation so that you can enter data points for the polygon.
1. number of polygon points (you should enter correct numer 33>N>2)
2. Xs and Ys coordinates for the polygon(in clockwise direction) you want to create ( comma separated values).
3. xs,ys coordinate for the laser pointer (light source).
Enter value and hit [b]setup (x,y)[/b] button ,and the simulation will display what you want.

19. Re: Prism: Reflection and refraction by:ali sayedat 2010/05/08 01:03Dear sir,
I was wondering if you would kindly give me the applet code for this java program. I will be very grateful to you sir...

20. Re: Prism: Reflection and refraction by:ahmedelshfieat 2010/05/08 02:41I'm not a demonstration of site is prof Hwang but i can help
You just need to press button [b]Get files for offline use[/b] and you
Will receive source code in your E-mail direct
you can do it by your self  :)

21. Re: Prism: Reflection and refraction by:ahmedelshfieat 2010/05/08 09:41Or you can use download file to revive in your PC direct too you choose
[b]Download file[/b] and after press [b]Get files for offline use[/b]

22. Re: Prism: Reflection and refraction by:carl_canat 2011/02/01 21:10Hello everyone,

I am new to this forum and glad to be a part of this. i hope that i can learn more and share my ideas and thoughts as well.
-*-

23. Re: Prism: Reflection and refraction by:Paulineat 2011/10/28 05:18This is so useful! If dove prism can be used in this simulation, that will be awesome!

24. Re: Prism: Reflection and refraction by:hwangat 2011/10/28 23:22You can use the above simulation to find out the condition for the dove prism to work.
i.e. How to cut a prism into a dove prism.

25. Re: Prism: Reflection and refraction by:miladat 2011/11/25 06:53any body can make me biprism diffraction?

26. Re: Prism: Reflection and refraction by:ahmedelshfieat 2011/11/25 17:17Hi milad,

take a look at this java applet may it waht you want Dispersion of light with prism  ;)

27. Re: Prism: Reflection and refraction by:bagsbedat 2012/04/14 16:30thanks...for...sharing....-*-