# NTNUJAVA Virtual Physics LaboratoryEnjoy the fun of physics with simulations! Backup site http://enjoy.phy.ntnu.edu.tw/ntnujava/

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

Title: Thin Lens (converging/diverging lens/mirrors)
Post by: Fu-Kwun Hwang on January 29, 2004, 11:02:28 pm
Equation for thin lens (http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=704.0): $\frac{1}{p}+\frac{1}{q}=\frac{1}{f}$ where p is the distance between object and lens, q is the distance between image and lens, and f is the focus length of lens.
 blue lines trace of light path green lines backward tracing for virtual image small red lines distances f and 2*f away from the center of lens. 1st textfield current mouse position (x , y) relative to lens white vertical line reference line (you can click and drag it left/right) yellow line light path for paraxial ray assumption(mirror only)

Parameters can be changed :
1. Select Lens for thin lens effect(default)

2. select mirror for concave/convex mirror effect

3. default: assume paraxial ray (you can turn it off)

4. press toggle button +/- to change between converging/diverginglens

5. Move the object

6. click near tip of the object, and drag it to where you like it and release the mouse button.

7. Move the lens/mirror:

8. click near center of the lens, and drag it to left or right.

if click with left mouse button, only lens will move.

if click with right mouse button, object will move with lens.

9. Change the focus length of the lens/mirror

10. click near the top/bottom of the lens/mirrir, then drag the mouse . Try it!

11. if you adjust the size of window, parameters reset to default values.

12. you can open more then one window to compare different cases, close the created window to Quit. Pressto open another Lens window!

13. you can change the following parameters inside the "textfield".
 Parameters distance defaults P object 20. q image 20. f focus 10. m=-q/p magnification 1.

You are welcomed to check out another related simulation :Relation 1/p+1/q=1/f (http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=704.0) and What will happened if part of the light path were blocked (http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=219.0)

You are welcomed to check out a wonderful thin Len flash animation (http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=1395.0) created by a teacher in Taiwan

(http://www.phy.ntnu.edu.tw/ntnujava/index.php?action=dlattach;topic=48.0;attach=3831;image)

Title: topic48
Post by: on January 30, 2004, 08:02:46 am
Subject: Lenses
Date: Sun, 01 Feb 1998 17:08:13 -0600
To: hwang@phy03.phy.ntnu.edu.tw
I stumbled into it one night while trying to find some insight on a physics assignment that I had.
I've used it ever since to check my work.
Something that might be helpful to a great number of people
would be a java applet with thick lenses and or two lense systems. Just a thought.
Thank you for taking the time to publish such a page John Eagle

Title: topic48
Post by: on January 30, 2004, 08:11:28 am
Subject: Lens/mirror
Date: Fri, 03 Apr 1998 16:16:37 -0600
From: Kelly <kpuls@students.wisc.edu>
To: hwang@phy03.phy.ntnu.edu.tw
Mr. Hwang, I want to say that your virtual lab was unbelievably helpful to me.
I attend the university of wisconsin-madison and I was having problems with optics concepts.
I went under the internet and searched under lens and mirrors and fell upon your lab.
I am very grateful. I was a little upset last night when I wanted to access the lens mirror applet,
because I couldn't find it.
I guess even the virtual labs have hours of availability.
I guess that's my only suggestion,
which isn't a very necessary one to attend to when most of us can access it during the day.
Thanks again, Chris cechapma@students.wisc.edu

Title: topic48
Post by: on January 30, 2004, 10:58:55 am

Subject: Wow!!!
Date: Sun, 03 May 1998 15:39:11 -0600
From: The Lahrs
To: hwang@phy03.phy.ntnu.edu.tw
I just figured out that the inverted image is not virtual but real,
so everything makes sense now.
Keep up the good work.
John C. Lahr

Title: topic48
Post by: on January 30, 2004, 10:59:36 am

Subject: Wow!!!
Date: Sun, 03 May 1998 12:47:55 -0600
From: The Lahrs
To: hwang@phy03.phy.ntnu.edu.tw
I love your thin lens page: http://www.phy.nau.edu/~layton/JavaApps/thinlens/lens_e.htm
What a great use of Java!
I use Netscape, by the way, and the applet worked just fine and was very speedy.
I've been trying to figure out why a glass rod creates an inverted (about one axis) virtual image.
Do you have an applet for a thick lens, or just a ray diagram that would show this effect?
Is the thinlens.java code still available? The link was not working when I tried.
It would be interesting to develop something like this for seismic waves.
I'm a seismologist now, but my first love is physics,
which was my undergraduate major at Rensselaer Polytechnic Institute.
Thanks again for providing the world this great applet.
John C. Lahr
-- * John C. and Jan H. Lahr * *
914 10th Street * *
(303) 215-9913 * *
http://www.lahr.org/john-jan * *

Title: topic48
Post by: on January 30, 2004, 11:33:55 am
Subject:  Thin Lens Java applet
Date:     Fri, 19 Feb 1999 18:00:24 +1100
From:     pevans@mentone.gsat.edu.au
To:       hwang@phy03.phy.ntnu.edu.tw
Hi

I was looking at your applet for the thin lens and really liked it. I am new to applets and
often it is possible to download them so that you can use them off line but I couldn't

I am a secondary teacher and would really like to show it to my students. Would I be
able to get a copy of it please.

Thanks

Pam Evans
pev@netspace.net.au
pevans@mentone.gsat.edu.au

Title: topic48
Post by: on January 30, 2004, 04:42:18 pm
From: Rick Matthews <matthews@wfu.edu>
Organization: Wake Forest University
To: hwang@phy03.phy.ntnu.edu.tw
Subject: Great applet!

I just discovered your lens applet. It is a great tool for
helping students come to understand lenses and mirrors.

Unless you object, I would like to assign a problem to my
students based on this applet.

--
Rick Matthews                             matthews@wfu.edu
Department of Physics                     http://www.wfu.edu/~matthews
Wake Forest University                    336-758-5340   (Voice)
Winston-Salem, NC 27109-7507              336-758-6142   (FAX)
USA

Title: Thin lens
Post by: on May 25, 2004, 02:08:12 am
This is an awesome lab for teaching ray diagrams and optics basics!  Thanks a bunch!

Title: topic48
Post by: on August 13, 2004, 04:14:50 pm
lixo

Title: topic48
Post by: on August 13, 2004, 04:29:52 pm
:shock:  :shock:  :shock:  :shock:  :shock:

Title: fuk off
Post by: on August 13, 2004, 08:08:45 pm
sup dude, yo this Thin Lens Demostration stuff rock!! i really enjoied it!! ill write a song now, c ya!

"go go go go go Go shory it's your birthday you gonna party like it's your birthday" by 50 cent

um abraço pra galera do marista

:lol:

Title: Class
Post by: on August 18, 2004, 09:01:05 pm
:arrow: This is an [b:134dfe8f92]amazing[/b:134dfe8f92] site man! very interesting to study lens and mirrors!! :P Now i can figure out how does it work! ;) As soon as you have news i'll be back! Se ya!!!

Title: Ohhh povo feio
Post by: on August 18, 2004, 09:07:28 pm
[b:73495ba837] Hadson é lindo!!!!!![/b:73495ba837], mas Enzo é muito chato e muito burro!! Klebinho é pegador!!!!!!!! Saulo parece c Silvio Santos, mas se acha muito!!!!!!!! Seus feios!!!
Gabarito de Matematica:
1- a)
2- b)

Title: topic48
Post by: patent on February 24, 2005, 07:16:57 pm
I have few stupid questions...

I see mainly converging lenses collecting rays to one poit (pix A)  but do they work another direction? (pix B) any differet solutions/ something usefull to know? I know I could use image conduit but they don't have enought resolution for 2000-3000 pixel CCD-bar/21mm wide...or I'm wrong?  :?:  In pictures arrow shows direction of ray.

(http://weightweenies.starbike.com/phpBB2/files/lensdemo_180.jpg)

Another Q is about focusing. Is there difference in working of D ja C assebly pictures? Are they equal?

Title: topic48
Post by: aauba on February 25, 2005, 02:28:10 am
i am very glad to see the applets, i would like see more of them :D

Title: thin lense
Post by: asdf on April 19, 2005, 02:05:24 am
This thin lense program is awesome!  How Long did it take you to make it?

Title: topic48
Post by: Fu-Kwun Hwang on April 19, 2005, 02:36:42 pm
[quote:f1f6840cd2]i am very glad to see the applets, i would like see more of them [/quote:f1f6840cd2]

You can try out the following applet!

http://www.phy.ntnu.edu.tw/ntnujava/viewtopic.php?t=174

:-)

Title: topic48
Post by: mustafadmrc on May 26, 2005, 04:48:34 am
Students won't be alfraid of physics with the help of  these java applets. All physics teachers must use java applets. These are very useful Thanks for sending us for free. :P

Title: topic48
Post by: Fu-Kwun Hwang on May 26, 2005, 12:12:10 pm
[quote:506d759f5b]I see mainly converging lenses collecting rays to one poit (pix A) but do they work another direction? (pix B) any differet solutions/ something usefull to know? I know I could use image conduit but they don't have enought resolution for 2000-3000 pixel CCD-bar/21mm wide...or I'm wrong?  In pictures arrow shows direction of ray. [/quote:506d759f5b]
Yes. The path of light ray is reversable.  If those parallel light really focus on one single point. You can place a light source at that point can create a parallel light output.

Post by: tulu on November 23, 2005, 10:44:28 am
I am not able to download the applet for offline use. When I press the "Get applets for offline use" button, I get a "no privilege" message in the next page.

Title: topic48
Post by: colos on November 25, 2005, 12:00:28 pm
When I check it with my browser with two different account.
It works fines with my netscape and IE browser.
Could you tell me what is your browser and the verson #?

Title: topic48
Post by: Arns on February 20, 2006, 02:41:39 pm
I am a new memeber. I have downloaded an applet, unfortunatley it is not working offline despite I have the version of JRE.

Title: topic48
Post by: Fu-Kwun Hwang on February 20, 2006, 03:58:53 pm
This applet was created with JDK1.0.2.
It should works for most of the browser.
You need to open lens_e.html with your browser.

If it still did not work. I need the error message from java console.

Title: Opening up the files in EJS program
Post by: thaddeusward on March 01, 2006, 10:55:18 am
Professor Hwang,

This app is great.  I would like to build off of your code to do a mirror simulation focused on some different ideas, but I don't can't get the app to open in the EJS interface so I can work on it.  Is there a way to do this?

Thanks,

-TW

Title: topic48
Post by: Fu-Kwun Hwang on March 02, 2006, 10:24:07 am
Applets under physics simulation category are created many years ago with JDK 1.0.2

Only those applets under "Easy Java SImulation" category are created with  ejs.
And you can view how it was created.

I am going to change the code and the server structure so that user can also edit ejs code and save the modified simulation on our server . (user also can get modified ejs code and all related files in ZIP format).

Title: topic48
Post by: Paste23 on April 05, 2006, 09:58:13 am
This is absolutly spiffingly amazing!  :D
It reminds me of things that are good!
This is very good program it is good. Not bad.
I is a Student at Taira High School in Japan. Arigatoo my freinds.
Gomibako ni sunde imasu.
Neko o tabemasu ka?
Thanks you my freinds
Munko?  :twisted:

Title: topic48
Post by: sanjeevgogna on May 17, 2006, 04:47:42 am

Title: topic48
Post by: Fu-Kwun Hwang on May 17, 2006, 08:57:17 am
Please try it again! It should work now.

Title: topic48
Post by: normariam on January 26, 2007, 10:03:31 am
i think this simulation is just great and i hope every student will be more understand

Title: Re: Thin Lens (converging/diverging lens/mirrors)
Post by: hak7011 on September 07, 2007, 01:34:31 pm
Is it possible to run the java script offline?

I can't find Lens.html after I have unzip the files...

Title: Re: Thin Lens (converging/diverging lens/mirrors)
Post by: Fu-Kwun Hwang on September 08, 2007, 05:16:21 pm
There are several html files in the ZIP file.
English version is lens_e.html
lens_kr.html is Korean version.
index.html is Chinese version.

Title: Re: Thin Lens (converging/diverging lens/mirrors)
Post by: aashoy on October 22, 2007, 04:42:35 pm
Hey !
I have come to such a virtual laboratory for the first time.It's exciting and stimulating.This's a real resource for teaching image fromation! Thanks a ton for letting it be free.

Title: Re: Thin Lens (converging/diverging lens/mirrors)
Post by: gon on October 23, 2007, 09:35:45 am

Title: Re: Thin Lens (converging/diverging lens/mirrors)
Post by: Fu-Kwun Hwang on October 23, 2007, 03:38:55 pm

Title: Re: Thin Lens (converging/diverging lens/mirrors)
Post by: radreamer14 on July 21, 2008, 05:43:06 pm
I really like the programs you've created especialy this one cause you could easily manipulate it and understand the concepts easily.

I just wondering how you did the program. What programs did you use and where could I get one or any similar program that would be somewhat easily to create and manipulate?

Thanks...

Title: Re: Thin Lens (converging/diverging lens/mirrors)
Post by: Fu-Kwun Hwang on July 21, 2008, 09:44:45 pm
This is the first java applet that I have created when I learned java almost 12 years ago (with JDK 1.0.2).

I used a text editor to wrote the code, line by line. Draw arrow, draw line ... etc.
And I have created near 100 java applets by the same way.
But I switch to EJS when listened to the talk by its author (Paco, he and I were invited to give a talk at AAPT meeting at the same session).
Please check the following similar applets which were all created with EJS. (and you can download EJS source and load it inot EJS and watch how I did it. You can modified it to generate new simulation,too.)

1. object in front of concave/convex lens   (http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=377.0)
2. object in front of concave/convex mirror (http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=376.0)
3. Lens (thick lens) and Mirror (http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=121.0)

It is much easier to create new simulation with EJS. This tool focus on the physics instead of java programming.

Title: Re: Thin Lens (converging/diverging lens/mirrors)
Post by: radreamer14 on August 05, 2008, 06:53:18 pm
Thank you so much for that.

May we ask permission to use EJS similar to the ray diagrams you've created as a device in an annual science competition in the Philippines if ever we would be able to get to the division, regionals and nationals? Our program is a little different because some lines in our ray diagrams are not shown there and we've also added its functions namely, concave, convex, double concave ad double convex.

Thank you very much!

Title: Re: Thin Lens (converging/diverging lens/mirrors)
Post by: Fu-Kwun Hwang on August 05, 2008, 09:31:02 pm
You are welcomed to use our simulations for educational purpose as long as you list URL to simulation page at this web site when you use it.

Title: Re: Thin Lens (converging/diverging lens/mirrors)
Post by: radreamer14 on August 06, 2008, 05:37:36 pm
Does it mean that we may present a similar version of this as our device for a competition(national maybe) as long as we place the URL of the simulation as one of our sources?

Anyway... thank you :)

Title: Re: Thin Lens (converging/diverging lens/mirrors)
Post by: Fu-Kwun Hwang on August 06, 2008, 10:57:57 pm
Yes, as long as you indicate the original source(URL).  And it will also let the organization aware of the situation.

I did not know what are the rules for the competition. It happened that some one use our simulation in one of the  competition, and they pretend it was done by their team. However, it was found out later when someone in the same competition search the web. So you should let people know what is the work you have really do!  I hope you can win the competition with your own work!   :D

Title: Re: Thin Lens (converging/diverging lens/mirrors)
Post by: radreamer14 on August 07, 2008, 06:08:11 pm
Our program using EJS is used differently that you would not use java codes or the java applet coz we only know HTML and QBASIC. It isn't draggable. In order to operate our program, the user will just use EJS and in the model, he/she may enter different values for the 3 different variables (f for focal length, d for distance of the object from the mirror and h for the height of the object). That is all what we can do.
Anyway.....
We'll do our best to improve our program!
Thanks for everything! ;D

Title: Re: Thin Lens (converging/diverging lens/mirrors)
Post by: awzh08@xtreme4.pipex.net on September 06, 2008, 03:45:31 am
:) :) ;) :D ;D

Title: Re: Thin Lens (converging/diverging lens/mirrors)
Post by: leeyiren on December 30, 2009, 11:48:27 pm
Profeesor firstly i downloaded this zipped file, inside dun even have 1 executable jar file. I cannot do anything with it.

secondly, may i know why does the light passing through the optical centre of the lens not get refracted? as in the one passing diagonally. we always draw a straight line. It should have a double refraction or else it is inaccurate for a ray diagram.

Title: Re: Thin Lens (converging/diverging lens/mirrors)
Post by: Fu-Kwun Hwang on December 31, 2009, 11:20:14 pm
1. Under JDK1.0.2 simulations (1996-2001): Those simulations are created before 2001. The download ZIP file contain java class file and html files. You need to unzip the file and view the html file (normally, xxx.html where xxx is the same as the downloaded zip file.
2. EJS simulatoions: Those are simulations created with EJS. The download file is a jar file. You can dooble click the jar file to run it. You can open it with EJS when right click the mouse button and select open ejs model option. There are many other options.

The above message are include in the email message you received when you request our server sent you file.

The simulation for this topic is a thin lens. It means that the width of the lens is ignored and approximation has been made. That is why you did not find double refraction for a ray pass through the center. You can find more accurate rar tracing from simulations for thick lens (http://thick lens) .

Title: Re: Thin Lens (converging/diverging lens/mirrors)
Post by: abd on April 24, 2010, 07:15:47 pm
[i want to save this simulation
how?

Title: Re: Thin Lens (converging/diverging lens/mirrors)
Post by: Fu-Kwun Hwang on April 24, 2010, 11:45:05 pm
Click "get file for offline use" button at the first mesage (where you find the simulation).

Title: Re: Thin Lens (converging/diverging lens/mirrors)
Post by: tladewski on June 11, 2011, 07:48:02 am
Hi!  Thanks for the great website!

I think I'm not understanding the download procedure for the Thin Lens simulation, because I didn't find a jar file in the download I requested.

The post I read says there are two different downloads, but when I downloaded the files, I only got html files, with some gif, class, and java files.  What should I be doing to get the jar file?

Thanks again for the great work!

Title: Re: Thin Lens (converging/diverging lens/mirrors)
Post by: Fu-Kwun Hwang on June 11, 2011, 03:19:01 pm
1. ZIP file: This is for simulations created before 2001 using JDK1.0.2: You should unzip the file and open index.html with your browser. (There is no jar file, but class files. )
2. JAR file: This is for simulations created after 2001 using EJS.
You can double click jar file to run it locally.

You will get the instruction if you ask our server to send file to your email account (first option).

Title: Re: topic48
Post by: Mio-Gonzalez on September 06, 2011, 03:18:13 pm
[quote:506d759f5b]I see mainly converging lenses collecting rays to one poit (pix A) but do they work another direction? (pix B) any differet solutions/ something usefull to know? I know I could use image conduit but they don't have enought resolution for 2000-3000 pixel CCD-bar/21mm wide...or I'm wrong?  In pictures arrow shows direction of ray. [/quote:506d759f5b]
Yes. The path of light ray is reversable.  If those parallel light really focus on one single point. You can place a light source at that point can create a parallel light output. Greetings, Max,-*-
Quite interesting question. Does anybody know?

Title: Re: topic48
Post by: Mio-Gonzalez on October 05, 2011, 03:33:15 am
bikeparts (http://www.starbike.com/index.php?cat=parts&lang=en)
[quote:506d759f5b]I see mainly converging lenses collecting rays to one poit (pix A) but do they work another direction? (pix B) any differet solutions/ something usefull to know? I know I could use image conduit but they don't have enought resolution for 2000-3000 pixel CCD-bar/21mm wide...or I'm wrong?  In pictures arrow shows direction of ray. [/quote:506d759f5b]
Yes. The path of light ray is reversable.  If those parallel light really focus on one single point. You can place a light source at that point can create a parallel light output. Greetings, Max,-*-
Quite interesting question. Does anybody know?

hmmmm :-/

Title: Re: Thin Lens (converging/diverging lens/mirrors)
Post by: Fu-Kwun Hwang on March 08, 2012, 04:39:20 pm
Quote
My name is Azhar and i am a big fan of your applets and i use it quite a bit in class to teach my classes.

Recently, I was using the thin lens demonstration and i noticed that as i brought the object from distance further away from 1 focal length to exactly to the focal length (object distance = focal length). The light rays go to infinity as expected.

However, as we bring the object from distance less than 1 focal length to exactly one focal length, light rays are shown to come out in the direction of the object, which indicates that there might be a virtual image formed somewhere far  far away.

I genuinely want to know which situation is really true.

This above is an email message I received today.
Light ray goes to infinity when the object is placed at the focus point. i.e. object distance=focus length.
When the object distance is less than focus length(no matter how small the difference might be), it will form virtual image.
When the object distance is more than focus length(no matter how small the difference might be), it will form real image.

From mathematic point of view or with the simulation, we can set object distance=focus length.
However, it is not possible to do so in real life. Because object has finite width and measurement always has finite error.

The simulation was designed so that some student might raise question and think about what really happened.

The purpose of my simulation is not to provide answer to the question student might have, but to provide opportunity for students to think about related physics.

I would suggest you to ask student discuss : is it possible to set object distance = focus length in real life?
Object has finite width. What will be seen when the center of mass of the object is placed at the focus point.
Part of the object distance is less than focus length and part of the object distance is larger than the focus length.

Provide opportunity for student to think is more important than provide answer to the student! :-)

Title: Re: Thin Lens (converging/diverging lens/mirrors)
Post by: melnik on March 14, 2012, 04:52:04 am

-*-

Title: Re: Thin Lens (converging/diverging lens/mirrors)
Post by: Fu-Kwun Hwang on March 14, 2012, 08:24:21 am

Title: Re: Thin Lens (converging/diverging lens/mirrors)
Post by: koclup1580 on December 29, 2012, 01:22:05 pm
thank you so much.

Title: Re: Thin Lens (converging/diverging lens/mirrors)
Post by: djman23 on March 31, 2017, 01:26:33 am
as

Title: Re: Thin Lens (converging/diverging lens/mirrors)
Post by: djman23 on March 31, 2017, 01:29:17 am
that was a great one!