NTNUJAVA Virtual Physics Laboratory

JDK1.0.2 simulations (1996-2001) => Optics => Topic started by: Fu-Kwun Hwang on January 29, 2004, 11:03:57 pm

Title: Prism: Reflection and refraction
Post by: Fu-Kwun Hwang on January 29, 2004, 11:03:57 pm

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.
Title: GREAT
Post by: on May 05, 2004, 07:56:12 pm
: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
Title: topic37
Post by: Fu-Kwun Hwang on May 06, 2004, 08:32:41 am
It will be similar to Physics of rainbow (http://www.phy.ntnu.edu.tw/ntnujava/viewtopic.php?t=61)
Title: Source code
Post by: Mattisse on May 26, 2006, 05:39:01 pm
We 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
Title: Re: Prism: Reflection and refraction
Post by: c00w on May 10, 2008, 12:26:20 pm
I was wondering if I could also get the source code so it can be modified.
Title: Re: Prism: Reflection and refraction
Post by: annacegu on February 08, 2010, 09:29:44 pm
Hi,

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.
Title: Re: Prism: Reflection and refraction
Post by: Fu-Kwun Hwang on February 09, 2010, 01:12:00 am
It 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 \$   heta_1\$(angle between incident beam and the normal vector).
Then, the refracted angle \$   heta_2=frac{n_1}{n_2}   heta_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!

Title: Re: Prism: Reflection and refraction
Post by: annacegu on February 09, 2010, 05:52:32 am
Hi,
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.
Title: Re: Prism: Reflection and refraction
Post by: Fu-Kwun Hwang on February 09, 2010, 01:25:58 pm
I just add those angle vaues at the top-left corner.
Title: Re: Prism: Reflection and refraction
Post by: annacegu on February 09, 2010, 03:28:54 pm
Thank you very much!
Title: Re: Prism: Reflection and refraction
Post by: liesenbergk on February 17, 2010, 07:47:23 pm
Dear 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.
Title: Re: Prism: Reflection and refraction
Post by: Fu-Kwun Hwang on February 18, 2010, 11:11:25 am
It 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?
Title: Re: Prism: Reflection and refraction
Post by: liesenbergk on February 19, 2010, 05:24:42 am

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!
Title: Re: Prism: Reflection and refraction
Post by: Fu-Kwun Hwang on February 19, 2010, 11:18:06 am
It is done. Please check out  Ray tracing (polygon: range from 3-10 faces) (http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=1434.0)

You are welcomed to check out the following similar/related applets
Dispersion of light with prism (http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=415.0) ,
Prsim optics (slow motion of light entering a prism) (http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=414.0) ,
It is fun to play with prism. (light trace and intensity due to refraction) (http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=412.0)
or Lens (thick lens) and Mirror (http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=121.0)
Title: Re: Prism: Reflection and refraction
Post by: liesenbergk on February 19, 2010, 06:08:50 pm
Dear 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.
Title: Re: Prism: Reflection and refraction
Post by: liesenbergk on February 23, 2010, 12:21:05 am
Dear 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!
Title: Re: Prism: Reflection and refraction
Post by: Fu-Kwun Hwang on February 23, 2010, 12:42:51 am
Please 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.
You were asking extendsion from prism to polygon, so I created the simulation Ray tracing (polygon: range from 3-32 faces) (http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=1434)
I can only guest what you might want.
You can try out Lens (thick lens) and Mirror (http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=121.0) 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!
Title: Re: Prism: Reflection and refraction
Post by: liesenbergk on February 23, 2010, 06:47:27 pm
Dear 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!
Title: Re: Prism: Reflection and refraction
Post by: Fu-Kwun Hwang on February 23, 2010, 10:34:24 pm
Yes. 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) (http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=1434)

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 setup (x,y) button ,and the simulation will display what you want.
Title: Re: Prism: Reflection and refraction
Post by: ali sayed on May 08, 2010, 01:03:28 am
Dear 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...
Title: Re: Prism: Reflection and refraction
Post by: ahmedelshfie on May 08, 2010, 02:41:12 am
I'm not a demonstration of site is prof Hwang but i can help
You just need to press button Get files for offline use and you
you can do it by your self  :)
Title: Re: Prism: Reflection and refraction
Post by: ahmedelshfie on May 08, 2010, 09:41:40 am

Title: Re: Prism: Reflection and refraction
Post by: carl_can on February 01, 2011, 09:10:54 pm
Hello 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.
[hide]

São Paulo Para-brisa Reparo (http://www.reparodeparabrisas.com.br/saopaulo.php)[/hide]
Title: Re: Prism: Reflection and refraction
Post by: Pauline on October 28, 2011, 05:18:58 am
This is so useful! If dove prism can be used in this simulation, that will be awesome!
Title: Re: Prism: Reflection and refraction
Post by: Fu-Kwun Hwang on October 28, 2011, 11:22:33 pm
You 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.