SlideShare a Scribd company logo
1 of 70
How to Allow Java Applets for physics labs
Windows 7
Open the lab
Copy and paste the lab site given to desired internet browser
Here I’m using google chrome, you can also use internet
explorer or firefox, same results
You will get a security warning click run. It may still not run…
If it doesn’t run go the start menu on your computer. Type java.
I click on the Java 32 bit under control panel.
Once opened properly it should look like this.
Click on the security tab, then click on edit site list
Once the exception site list is up click add
Type in the address given. Make sure to first type http:// you
do not need the entire site just the main web site title for
example http://phy.ntnu.edu.tw
then click add
It will say this is a risk, allow it (click continue) the school
would not give you a website that gives you a virus.
Now you are done. Simply reload your web page and you should
be able to run the java applet.
Note, we have used about 4 different lab sites that use java this
means you have to do this for every new website.
Coaching Principles
Chapters 1-3
Coaching Philosophies, Coaching Objectives & Coaching Styles
Developing Your Coaching Philosophy
You have certain beliefs and principles
Situations occur, events happen
You respond based on your beliefs/principles
You experience consequences
Your beliefs change, adjust or solidify
The Wildcat Scenario, Page 1
Coach Mitchell’s football Wildcats are down 14-10 with one
minute to play. The fans scream as “Recordbook Rodney”, his
star tailback, spins away from two tackles, dodges another, then
lunges forward, tackled at the 6 yard line, just short of the end
zone. Cheering teammates surround Rodney, who – unseen by
the officials – throws a cheap shot to the kidney of his tackler.
When Rodney gets to his feet, he spits toward the tackler, who
is in obvious pain, and then glances to the sidelines to find
Coach Mitchell’s eyes fixed on him. It’s obvious to both of
them that his actions have flown square in the face of the team
philosophy and rules. (Cont.)
The Wildcat Scenario, Page 2
The refs call in the chains while the other team’s trainer assists
the injured tackler. The crowd roars as the signal is given: first
down and goal. Coach Mitchell calls a time out. Several
players slap Rodney on the back as they run to the sidelines,
and the PA announcer says, “This is it, Wildcat fans! Six yards
away from the first playoff season in 15 years of Huntsville
football.” Coach Mitchell is under tremendous pressure to
return the Huntsville program to previous glory. Rodney has
displayed flagrant and dangerous unsportsmanlike behavior,
seen by the coach. What should Coach Mitchell do? What
would you do if you were Coach Mitchell?
Developing Your Philosophy
Requires:
Knowing yourself
Reflection
Self-Disclosure
Your different “selves”
Public Self
Ideal Self
Real Self
Self-Esteem and Self-Disclosure
How do you value yourself?
Do you often judge yourself harshly?
How much of yourself is known by others?
How much of yourself is not known by others?
How much of yourself is not known by you?
How do you find out how others view you?
Determining Your Coaching Objectives
Goals of Coaches Usually Fall into Three Broad Categories
Win
Fun
Develop the Athletes:
Physically
Psychologically
Socially
Assessing Your Objectives
The best coaches are those who…Dev.FunWinGive individual
help and are interested in athlete developmentMake practices
and games funTeach athletes the skills needed to winIf a news
story were written about meCoach who contributed to the dev of
youngst.A coach for whom athletes enjoyed playingA winning
coachAs a coach I emphasize…Teaching skills that young
people can use later in lifeHaving funWinning
What is the ASEP Philosophy?
ASEP - American Sport Education Program
Athletes First, Winning Second
Vince Lombardi – Did he really say, “winning isn’t everything,
it’s the only thing” ?
Is “athletes first, winning second” realistic in today’s society?
Your Personal Objectives
Why do you want to coach?
Can you balance winning, having fun, and developing the
athlete?
Are your coaching objectives compatible with the objectives of
your program?
Bill of Rights for Young Athletes
The Right To:
qualified adult leadership
play as a child & not as an adult
participate at an appropriate level, participate in a safe and
healthy environment
proper preparation
share in the leadership and decision-making
equal opportunity for success
be treated with dignity
have fun in sports
Consider your goals
Consider how you feel about “athletes first, winning second”
Consider the emphasis you place on winning
Consider the commitment it takes
Consider the importance of ethical behavior in coaching
So, As You Develop Your Philosophy
Your Coaching Style
Most coaches lean toward one of three coaching styles:
Command – very coach-centered (dictator)
Submissive – impact of the coach is minimal (babysitter)
Cooperative – coach and athletes share in the decision making
(teacher)
Leadership in Coaching
Regardless of your style, as a coach you must be a leader to be
successful.
There are 3 other key qualities of successful coaches:
Knowledge of the sport
Motivation
Empathy
Leaders:
Provide direction
Build a psychological and social environment that is conducive
to achievement
Instill values, in part by sharing their philosophy of life
Motivate members of the group to pursue the goals of the group
Confront group members when problems arrive and resolve
conflicts
Communicate
What is Team Culture?
Components of Team Culture
Team Traditions
Basic Operating Procedures
Management of Information
Nature of the Sport
Power, influence, and status structure within the team
Leadership style of the coach
Build A Positive Team Culture
Involve your athletes in defining team goals
Give your athletes appropriate responsibilities
Know your sport
Treat each athlete with respect
Be consistent with rewards and recognition of excellent
performance and effort, not outcomes
Coaching Code of Ethics
National Standards for Sport Coaches:
Standard 1
Develop an athlete- centered philosophy
Standard 2
Identify, model, and teach positive values learned through sport
participation
Sample Lab Report:
Please note:
This is a fairly nice lab report of an experiment that should
provide a guide to you for producing your own lab reports.
Your report should usually contain the following ingredients:
1. Introduction of the purpose of the experiment
2. Description of the measurement procedure
3. Listing of the data you obtained, with formulas used in
extraction of these data.
4. Graphic representation of your data and possible
comparison to theoretical
predictions
5. Discussion of possible errors and uncertainties
6. Conclusion with clearly stated outcomes of the experiment
Experiment: Bouncing Golf Ball
Introduction
In this experiment we used the PASCO Science Workshop
Equipment, KaliedaGraph, Microsoft Word and Excel, and a
golf ball in order to investigate the potential, total, and kinetic
energy of a ball that bounces off the ground. Our purpose is to
determine as precisely as possible how much energy is lost in
the bounce of the ball and to observe how well the energy is
conserved throughout the flight. We believe that if the air
resistance is neglected, then the ball that is dropped should
conserve total energy as it falls. However, because the ground is
not a totally elastic surface, some of the energy will be lost. We
will therefore observe the total energy as a function of time so
as to determine whether the energy is lost in the actual bounce
of the ball into an inelastic surface, or due to air friction.
Procedure
First we needed to set up the equipment which contained a
motion sensor and a golf ball. The golf ball was weighed and
the height of the sensor, h, was measured with the digital meter
on the sensor. The distance we are actually measuring, though,
is the distance between the ground and the sensor because we
are subtracting the distance from the motion sensor to the ball.
We need to correct for the diameter of the ball because the
distance from the motion sensor to the top of the ball is what
the sensor is measuring, not the distance from the sensor to the
ground. In order to do this we subtracted the diameter of the
ball from h.
Now that we were ready to begin the experiment, we held the
ball below the sensor enough so its position is recorded and we
began the recording and let the ball drop. After a few practice
drops, we chose the ‘best’ data that allowed us to see a graph of
d, the distance between the motion sensor and the ball versus
time. A graph was created in Science Workshop displaying our
data. More graphs and tables were then created.
Data and Observations
Formulas:
Kinetic energy = ½ m v2
Potential energy = m g h
Total energy = kinetic + potential energy
Kinetic energy is the energy an object has while in motion. An
object loses kinetic energy each time it hits a non-elastic
surface. Kinetic energy is dependent upon the mass of the object
and the velocity the object is moving with. The sharp decreases
at t = 1.2 and 2.0 s are where the ball hit the ground.
Potential energy is the possible amount of energy an object has
before any movement. Potential energy is dependent upon the
mass of the object, acceleration due to gravity and the height of
the object. Each time the object falls it loses potential energy
and each time it returns it gains potential energy. At t = 0.3, 1.2
and 2.0 s the ball hits the ground. This is because potential
energy is lowest when the ball hits the ground.
The total energy is the sum of both the kinetic and potential
energy. At t = 0.3, 1.2, and 2.0 s the ball is striking the ground.
We know this because at these times the ball has it’s lowest
amount of energy. This is a step-like function because when the
kinetic energy is at its peak, potential energy is at its valley,
and vice versa. This creates horizontal lines when they are
added.
Conclusions
Our purpose of the experiment was met because we were able to
successfully investigate and observe kinetic, potential, and the
total energy of a bouncing golf ball. From our observations, we
are able to conclude that the ball loses energy each and every
time the ball hits the ground and bounces back. This is
especially noticeable in the graph of the total energy. In regards
to air resistance versus elasticity, we concluded that the amount
of energy lost through air resistance is negligible compared to
the amount of energy lost through contact of the golf ball with
the ground.
During the motion of the ball, kinetic energy is not being
conserved but rather distributed into the ground. This energy
transfers because the ground is not an elastic surface. The total
energy slightly decreases also due to the inelasticity of the
bounce. The Law of Conservation of Energy does hold for this
case, however, because the energy is not being destroyed rather
it is being transferred.
Each bounce created a total energy loss of approximately 0.9 J.
The energy was lost in the actual bounce rather than in the air.
This is because if the ball bounced on an elastic surface, the
energy of each bounce would be roughly equal and the ball
would return to its starting height. Because the experiment did
not use a perfectly elastic surface, we can be fairly sure that the
bounce was the actual cause of the loss of total energy, rather
than the air resistance.
Colors
Web Site:
http://www.phy.ntnu.edu.tw/java/image/rgbColor.htmlOR
http://users.hal-
pc.org/~clement/Simulations/Mixing%20Colors/rgbColor.html
(Either website will work for this lab-please use whichever one
loads for you!)
Introduction:
Thomas Young, in the early 1800s, showed that a broad range of
colors can be generated by mixing three beams of light,
provided their frequencies were widely separately. When three
such beams combine to produce white light, they are called
primary colors.
There is no single unique set of these primaries, nor do they
have to be made up of single (monochromatic) colors.
The three components (emitted by three phosphors) that
generate the whole gamut of hues as seen on a color TV set are
Red, Green, and Blue. These are the primary colors.
Looking through a colored window or cloth is another story.
Yellow cloth, paper, dye, paint, and ink all selectively absorb
blue, and reflect what remains – yellow. And that is why they
appear yellow.
When dealing with pigments (paints), the primary pigments are
yellow, magenta (a light violet color), and cyan (a bluish-green
hue).
This Java applet let you play with mixing light beams and paint
pigments.
Instructions:
1. Load up the Java Lab from the web site shown above.
2. Click the right mouse button twice quickly to switch
between two different modes:
a. Mixing light beams (black background)
b. Mixing paint pigments (white background)
3. Set the screen for mixing light beams.
4. Click the left mouse button and drag one of the colored
ovals to move it around.
5. Determine what colors are obtained when two of the ovals
intersect each other. Do this for all combinations of two ovals.
6. What color is obtained when the three ovals intersect each
other?
7. Set the screen for mixing paint pigments.
8. Repeat steps 4 through 6 for paint pigments.
9. Finally, write the report telling what results were obtained
in this experiment with your favorite word processor or text
editor and submit is to the instructor.
Use the “Sample Laboratory Report” as a guide in preparing
your lab report.
Any problems – please e-mail me. Also if you have any
complaints, comments, suggestions, or kudos concerning this
experiment, please e-mail me. It won’t help your class, but I
will take them into consideration for the next time this course is
offered
Mirrors
Web Site:
http://www.phy.ntnu.edu.tw/java/Lens/lens_e.html
Instructions:
1. Load up the Java Lab from the web site shown above.
2. Select “Mirror”
3. Press toggle button to “+” (if it’s not already shown) to
indicate a converging (concave) mirror.
4. Press the “Reset” button. The value of p (the object’s
location) should be 20.0, the value of q (the image location)
should be 20.0, the value of f should be +10.0, and “Paraxial”
should be checked)
5. Move the object (the blue arrow) to the following positions
(p): 30.0, 25.0, 20.0, 15.0, 10.0, and 5.0. (Click near tip of the
object, and drag it to where you want to place it, and then
release the mouse button.)
6. For each position of the object, record the location of the
image (q) and the type of image (real or virtual), as well as the
magnification (M) of the image.
7. Plot a graph showing the object’s position (x-axis) versus
the image position (y-axis).
8. Plot a graph of the object’s position (x-axis) versus the
magnification (y-axis).
9. Press the toggle button to “-“ to indicate a diverging
(convex) mirror.
10. Repeat steps 5 through 8 for this mirror.
11. Finally, write the report with your favorite word processor
or text editor and submit is to the instructor. In this report
discuss the effects produced when a mirror has a large
curvature.
Use the “Sample Laboratory Report” as a guide in preparing
your lab report.
Any problems – please e-mail me. Also if you have any
complaints, comments, suggestions, or kudos concerning this
experiment, please e-mail me. It won’t help your class, but I
will take them into consideration for the next time this course is
offered.
optics/ABline.classsynchronizedclass ABline {
static double eps;
static double PI2;
int xa;
int ya;
int xb;
int yb;
double ca;
double cb;
double m;
double b;
double index;
double x;
double y;
double len;
double cta;
double alpha;
double r12p;
double r12s;
boolean total;
double rc;
double twoPI;
void draw(java.awt.Graphics);
void translate(int, int);
void setPoints(int, int, int, int);
double angle(double, double, double, double);
boolean touch(ray);
ray reflection(ray);
ray refraction(ray);
void ABline(double);
static void <clinit>();
}
optics/box.classpublicsynchronizedclass box extends
java.applet.Applet {
double time;
java.awt.Dimension area;
java.awt.Image bgImage;
java.awt.Image fgImage;
java.awt.Graphics gb;
java.awt.Graphics g;
java.awt.Color bgColor;
String rts;
String[] STR;
int xx;
int yy;
boolean rightClick;
int size;
int size2;
int size4;
int dragLight;
boolean changed;
int xs;
int ys;
java.awt.FontMetrics fm;
int chy;
int tx;
int ty;
int[] b;
int xc;
boolean display;
java.awt.Point[] light;
double len;
double index;
java.awt.Polygon hp;
java.awt.Polygon tp;
double PI6;
double LEN;
boolean showC;
public void init();
String d2String(double);
public boolean mouseDown(java.awt.Event, int, int);
public boolean mouseDrag(java.awt.Event, int, int);
public boolean mouseUp(java.awt.Event, int, int);
public boolean mouseMove(java.awt.Event, int, int);
void clear(boolean);
public void paint(java.awt.Graphics);
void drawPointer(java.awt.Point, java.awt.Point);
public void update(java.awt.Graphics);
void drawRay(double, double, double);
public void box();
}
optics/c1.gif
optics/c2.gif
optics/er.gif
optics/esp.gif
optics/eye.gif
optics/eyescan.gif
optics/fiber.classpublicsynchronizedclass fiber extends
java.applet.Applet {
double time;
java.awt.Dimension area;
java.awt.Image bgImage;
java.awt.Image fgImage;
java.awt.Graphics gb;
java.awt.Graphics g;
java.awt.Color bgColor;
String rts;
String[] STR;
java.awt.TextField tf;
int xs;
int ys;
boolean rightClick;
boolean draghead;
boolean dragtail;
java.awt.FontMetrics fm;
int chy;
int x1;
int y1;
int y2;
int xx;
int yy;
int dd;
java.awt.Point head;
java.awt.Point tail;
double m;
double b;
double x;
double y;
double sc2;
double tc2;
double n;
java.awt.Polygon hp;
java.awt.Polygon tp;
double PI6;
double LEN;
double cta;
public void init();
public boolean action(java.awt.Event, Object);
String d2String(double);
public boolean mouseDown(java.awt.Event, int, int);
public boolean mouseDrag(java.awt.Event, int, int);
public boolean mouseUp(java.awt.Event, int, int);
void clear();
public void paint(java.awt.Graphics);
public void update(java.awt.Graphics);
double drawIt(double, double, double);
void drawPointer(java.awt.Point, java.awt.Point);
public void fiber();
}
optics/fish.swf
optics/i.gif
optics/ie.gif
optics/image.classpublicsynchronizedclass image extends
java.applet.Applet implements Runnable {
java.awt.Dimension area;
java.awt.Image bgImage;
java.awt.Image fgImage;
java.awt.Graphics gb;
java.awt.Graphics g;
java.awt.Color bgColor;
String rts;
String[] STR;
int xx;
int yy;
int xs2;
int ys2;
boolean running;
Thread animThread;
long startTime;
long lastTime;
long delay;
long delta;
double c;
int cnt;
int ns;
double xt;
double yt;
double bt;
boolean rightClick;
boolean dragm;
boolean dragd;
boolean dragd2;
boolean down;
int xs;
int ys;
double cta1;
double cta2;
double ctaa;
double dd;
double PI2;
double m;
int ni;
int nf;
int n;
double V;
double dc2;
java.awt.FontMetrics fm;
int chy;
int xc;
int yc;
int size;
int size2;
int xm;
int ym;
int ym2;
int Nmax;
int NR;
int Nmax1;
double cta;
double rm;
double dc;
double[] CR;
double[] X;
double[] Y;
double[] VX;
double[] VY;
double cst;
int NI;
double[] PXA;
double[] PYA;
double[] PXB;
double[] PYB;
java.awt.Point na;
java.awt.Point nb;
public void init();
public void reset();
public void start();
public void stop();
public void run();
void advanced(double);
public boolean mouseDown(java.awt.Event, int, int);
public boolean mouseDrag(java.awt.Event, int, int);
void setupRay();
public boolean mouseUp(java.awt.Event, int, int);
void clear();
public void paint(java.awt.Graphics);
void imgs(double, double, double[], double[],
java.awt.Point);
public void update(java.awt.Graphics);
public void image();
}
optics/image_e.htmlMultiple
Reflection from two plane mirrors
Rays of lights are reflected from the mirror, each ray satisfying
the
law of reflection.
It is fun to play with two plane mirrors, multiple images are
formed.
Would you like to try it with this java applet?
The inverted moving fish (virtual image) is what the observer
(fish
on the left) will see underwater.
When the moving fish is away from the observer,
light emitter from the moving fish will be totally
reflected at the water-air interface.
So the water-air interface acting like a mirror.
When the distance is too short for the total internal reflection to
occurs,
the virtual image above the water vanished.
You can click and drag the observer left/right to change its
location.
More information will be shown when you drag the observer
(fish).Why does a fish appear to be closer to the surface of
water
than it really is?
The following java applet let you find out the answer,
and learn the physics of refraction, and total internal
reflection.
[removed]
[removed]
Usage:
A scanning eye represent the observer. You can click on it
and drag it to any position you like.
The whole screen will be clear when you drag the scanning eye.
You can draw any pattern you like, and the java program will
draw the
virtual image of it.
( If the virtual can be formed due to refraction or total internal
reflection)
When you draw in the water region,
the region where the total internal reflection
is possible, will be shown.
If you click the right mouse button, it will show you many light
rays
emitted.
(including refraction rays and total internal reflection
rays)
Right click the mouse button twice is another way to clear the
screen.to java applet
This is an image
You can draw any thing within the animation region,
for example: the object shown in the above image.
Light emitted from the object is refracted at the water and air
interface.
The observer trace back those refracted light to find the image
of
the object.
The image appear closer to the water surface and its shape is
different
from the object.
How to determine the location of the image (yellow dot) ?
The world viewed under water is different from what we view it
above
the water surface.
Drag the observer (eye) under the water and find out more
interesting
phenomena.
Your suggestions are highly appreciated! Please click
[email protected]Author¡GFu-Kwun Hwang, Dept. of physics,
National Taiwan Normal University
Last modified :
More
physics related java applets
optics/point.classsynchronizedclass point {
static java.awt.Graphics gb;
static java.awt.Rectangle r;
static double n;
static int cnt;
double x;
double y;
double vx;
double vy;
double v;
double c;
int status;
void set(double, double, double, double);
static void init(java.awt.Graphics, java.awt.Rectangle,
double);
point advanced(double);
void point(double, double, double, double);
}
optics/prism.classpublicclass prism extends java.applet.Applet {
double time;
java.awt.Dimension area;
java.awt.Image bgImage;
java.awt.Image fgImage;
java.awt.Graphics gb;
java.awt.Graphics g;
java.awt.Color bgColor;
int xx;
int yy;
boolean rightClick;
boolean movep;
boolean dragt;
boolean dragh;
boolean dragp;
int xs;
int ys;
boolean check;
double[] C;
double PI2;
java.awt.FontMetrics fm;
prisms p;
int chy;
int xa;
java.awt.Rectangle box;
java.awt.Point head;
java.awt.Point tail;
int N;
int n;
int N2;
double V;
ray light;
double I;
int size;
int size2;
double dist;
double angle;
java.awt.Polygon hp;
java.awt.Polygon tp;
double PI6;
double cta;
double ctaa;
double c2a;
double LEN;
double maxI;
int maxCnt;
int Cnt;
ABline AB;
public void init();
public void reset();
String d2String(double);
public boolean mouseDown(java.awt.Event, int, int);
public boolean mouseDrag(java.awt.Event, int, int);
public boolean mouseUp(java.awt.Event, int, int);
public void changeIndex(double);
void clear();
public void paint(java.awt.Graphics);
public void update(java.awt.Graphics);
void drawPointer(java.awt.Point, java.awt.Point);
ray drawRay(ray);
void drawTo(ray);
ABline getTouch(ray);
public void prism();
}
optics/prisms.classclass prisms {
int N;
int N1;
java.awt.Polygon P;
int xc;
int yc;
double[] L;
double[] C;
double PI2;
ABline[] AB;
java.awt.Rectangle r;
int size;
int size2;
double ax;
double ay;
double bx;
double by;
double ac;
double dv;
double c2a;
int dragID;
void prisms(int, int, double, double);
void setXY();
void setLine(int);
void drawPrism(java.awt.Graphics, java.awt.Color);
void drawAngles(java.awt.Graphics, int, int);
double angleAB(int, int, int);
void fillPrism(java.awt.Graphics, java.awt.Color);
void translate(int, int);
boolean checkDrag(int, int);
void drag(int, int);
}
optics/prism_e.html
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)
[removed]
[removed]
[removed]
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.to java applet
Your suggestions are highly appreciated! Please click
[email protected]Author:Fu-Kwun Hwang, Dept. of physics,
National Taiwan Normal University
Last modified :
More
physics related java applets
optics/r12p.gif
optics/r12s.gif
optics/ray.classsynchronizedclass ray {
double x;
double y;
double cta;
double r;
double p;
boolean fromAir;
double eps;
java.awt.Color color(float);
void setAngle(int, int, int, int);
void setXY(int, int);
double intensity();
void ray(int, int);
void ray();
void ray(double, double, double, double, double, boolean);
}
optics/refraction.classpublicsynchronizedclass refraction
extends java.applet.Applet implements Runnable {
int yOffset;
double time;
java.awt.Dimension area;
java.awt.Image bgImage;
java.awt.Image fgImage;
java.awt.Graphics gb;
java.awt.Graphics g;
java.awt.Color bgColor;
String rts;
String[] STR;
int xx;
int yy;
boolean running;
Thread animThread;
long startTime;
long lastTime;
long delay;
long delta;
point p;
boolean rightClick;
java.awt.FontMetrics fm;
int chy;
int tx;
int ty;
int yc;
int xp;
int yp;
int N;
int ray2cnt;
double n;
point[] ray;
point[] ray2;
java.awt.Rectangle r;
double vw;
int size;
int size2;
public void init();
public boolean action(java.awt.Event, Object);
public void reset();
String d2String(double);
public void start();
public void stop();
public void run();
void advanced(double);
public boolean mouseDown(java.awt.Event, int, int);
public boolean mouseDrag(java.awt.Event, int, int);
public boolean mouseUp(java.awt.Event, int, int);
void clear();
public void paint(java.awt.Graphics);
public void update(java.awt.Graphics);
public void refraction();
}
optics/shadow.classpublicsynchronizedclass shadow extends
java.applet.Applet implements Runnable {
double time;
java.awt.Dimension area;
java.awt.Image bgImage;
java.awt.Image fgImage;
java.awt.Graphics gb;
java.awt.Graphics g;
java.awt.Color bgColor;
String rts;
String[] STR;
int xx;
int yy;
boolean running;
Thread animThread;
long startTime;
long lastTime;
long delay;
long delta;
boolean rightClick;
boolean dragr;
java.awt.FontMetrics fm;
int chy;
int tx;
int ty;
int x0;
int y0;
int size;
int size2;
int xc;
java.awt.Rectangle r;
java.awt.Rectangle s;
double m;
double b;
double x1;
double x2;
double y1;
double y2;
public void init();
public boolean action(java.awt.Event, Object);
public void reset();
String d2String(double);
public void start();
public void stop();
public void run();
void advanced(double);
public boolean mouseDown(java.awt.Event, int, int);
public boolean mouseDrag(java.awt.Event, int, int);
public boolean mouseUp(java.awt.Event, int, int);
void clear();
public void paint(java.awt.Graphics);
public void update(java.awt.Graphics);
public void shadow();
}
optics/shadow.html
標題
起頭
[removed]
[removed]
[removed]
使用說明:
物理解說:to java applet
歡迎批評指教! 電子郵件 : 請按 [email protected]
作者:國立台灣師範大學物理系黃福坤
最後修訂時間:
rgbColor.htmlColorsThomas Young, in the early 1800s, showed
that a broad range
of colors can be generated
by mixing three beams of light, provided their frequencies
were widely separately.
When three such beams combine to produce white light,
there are called primary colors.
There is no single unique set of these primaries, nor do they
have
to be monochromatic.
The three components (emitted by three phoshors) that generate
the whole
gamut of hues
seen on a color TV set are Red, Green, Blue.
Looking through a colored window or cloth is another story.
Yellow cloth, paper, dye, paint, and ink all selectively
absorb blue
and reflect what remains
- yellow - and that is why they appear yellow.
This java applet let you play with mixing light beams and paint
pigments.
[removed]
[removed]
[removed]
[removed]
[removed]
Click the right mouse button twice quickly to switch between
two different
modes:
ModebackgroundMixing light beamsblackMixing paint
pigmentswhite
Click left mouse button and drag one of the colored oval to
move it
around.
Enter RGB values into the text field to change the color of the
selected
oval.
The color code (RGB value) at the mouse tip are shown in
colored background.
Related Link: Director animation for mixing
color/paint
Your suggestions are highly appreciated! Please click
[email protected]Author¡GFu-Kwun Hwang, Dept. of physics,
National Taiwan Normal University
Last modified :
More physics related
java applets
rgbColor_kr.html
색토마스 영(Thomas Young)은 1800년대 초에 빛의 세 개의
빛의 조합으로 이루어져 있다는 것을 보여 주었다.(이 빛은 각각의
진동수에
따라 분리된다.)
이것을 빛의 3원색(primary colors)라고 부른다. 이것은
유일 집합도 아니고, 꼭 단파장일 필요도 없다.
이 세 요소는(세 위상에 의해서 발진한) 색상의 전영역을
만든다.
우리는 칼라 TV브라운관에서 이것을 확인할 수 있다.(빨강,
녹색, 파랑)
노란옷, 종이, 페인트, 잉크 등은 모두 선택적으로
다른색은 흡수하고, 남아 있는 것(노란색)은 반사한다. 그래서 우리는
노랗게
보는 것이다.
이 자바 애플릿은 빛의 혼합과
물감의 혼합을 직접해 볼 수 있다.
[removed]
[removed]
[removed]
[removed]
[removed]
오른쪽 마우스 버튼으로 더블클릭하면, 두 모드가 서로 변환이
된다
모 드배경색빛의 혼합검은색물감의 혼합흰색
각 색깔의 타원은 왼쪽 마우스 버튼으로 드래그하여 위치를
이동시킬 수 있다.
각 타원의 색깔을 바꾸기 위해, RGB 값을 텍스트필드에 입력한다.
마우스 커서가 있는 위치의 색깔코드(RGB값)도 좌측상단에서
확인할 수 있다.
관계된 링크 : 빛과
물감의 혼합에 대한 디렉터 애니메이션
Your suggestions are highly appreciated! Please click
[email protected]
Author:Fu-Kwun Hwang, Dept. of physics, National Taiwan
Normal University
Translator : 신범철,
SBC물리마을
Last modified :
rgbLight.html
光色彩的疊加 與 塗料顏色混和
電視或電腦螢幕的各種繽紛的彩色 不過是三種基本顏色光點
俗稱三原光 『紅 綠 藍』 配合強度的變化組合而成。
想知道 電視或電腦所謂的三原光 是 如何組合成各式不同色彩的 光點嗎?
當 在畫紙上塗鴉時,不同顏色的顏料組合後 又呈現新的色彩。
所謂 三原色 『紅 黃 藍』 也可組成各種不同的色彩。
三原色中的『 紅藍』色彩 和 三原光中的『紅藍』色光
又有什麼不同呢?
其中的關係如何呢?
以下動畫 讓你玩一玩 『色光的疊加』與『色彩的混和』
[removed]
[removed]
[removed]
[removed]
[removed]
使用說明:
1. 首先你看到的是 黑色背景 光線的疊加。
三原光 『紅綠藍』 各以電腦螢幕所顯示的方式出現。
兩種光線重疊的部份則顯示出 另三種不同的色光。
三光線完全重疊處 則呈現白色。
一般電腦常將 三基本光線 強度分為 256種等級。
最弱為 0 最強則為255。則可以有
28*28*28 =
224 = 16M (1M約為一百萬)種組合。
當滑鼠在動畫區內移動時,上方 紅 綠 藍 方塊區域內會顯示
滑鼠所在位置 對應 電腦光點的 RGB數值。
以滑鼠左鍵分別點選 任一色光(點沒有重疊處會較清楚知道選的是誰)
上方 R G B 的空格會分別顯示所點選 色光 紅綠藍 RGB 分別的強度
你也可以輸入其他數值 (0-255間) 以更改 動畫中的色光顏色。
觀察組合結果有何不同!各種不同的組合將夠你好好的玩一下!
你能發現 疊加處的 RGB數值 和 個別色光RGB數值間的關係嗎?
2. 點選色光時若按住滑鼠 且移動滑鼠鍵 則可以改變該色光的位置。
3. 若快速按滑鼠右鍵 兩次,則背景將改為白色,動畫轉成 顏料的混和。
此時我所挑選的三原色 和 原來的三原光 有何特殊的關係?
同時注意 比較
三原色的混和區 、三原光
三原光的疊加區 、三原色
發現其間的關係了嗎?
顏色的混和時上面顯示的RGB數值又是怎樣的關係呢?
不同波長所對應約略的 RGB 數值
物理提示:
光線可以直接射入眼中或經過反射後 進入眼中。
塗料的顏色是 光線照射到塗料後,部份光線被吸收,
反射的光線則進入眼中後 呈現所看到的色彩。(類似於濾光片)
例如:紅色的顏料會吸收日光中大部份的綠光與藍光,
僅剩下紅光較能反射出來,因此看到紅色。
黑紙則幾乎吸收所有的入射光線。(並不見得完全吸收)
相關網頁 你所看到的色彩電燈泡的物理
歡迎批評指教! 電子郵件 : 請按
[email protected]作者:國立台灣師範大學物理系黃福坤最後修訂時間:
ripple.html
波的干涉
以下是 兩組同心圓 用以表示 波動的 波前。
是否觀察到有一些 條紋的錯覺呢?
那些條紋與 波動的建設性干涉處是否相關呢?
使用說明:
在區域內按下滑鼠左鍵 將顯示兩波源分別到滑鼠的距離(以波長為單位)。
在同一道條紋內兩波源間的距離差 有何特殊之處呢?
按下滑鼠右鍵後拖動滑鼠 則可以移動其中一個波源的位置。
好好的玩一玩 同時觀察其中的規律性 !
歡迎批評指教! 電子郵件 : 請按
[email protected]作者:國立台灣師範大學物理系黃福坤最後修訂時間:
fkhSprite.classsynchronizedclass fkhSprite extends
java.awt.Rectangle {
staticfinal double PI2 = 1.5707963267948966;
int[] pix;
int index;
int color;
void init(int, int, int, int);
void init(int, int, int, int, java.awt.Color);
void setColor(java.awt.Color);
void setColor(int);
void transparent(java.awt.Color);
void eraseBackground(java.awt.Color);
void fillOval();
void Circles(int, java.awt.Color);
void fkhSprite(int, int);
void fkhSprite(int, int, int, int);
void fkhSprite(int, int, int, int, java.awt.Color);
void fkhSprite(int, int, int, int, java.awt.Image);
}
fkhStage.classsynchronizedclass fkhStage extends fkhSprite {
staticfinal int COPY = 0;
staticfinal int OR = 1;
staticfinal int AND = 2;
int Npts;
int count;
java.util.Vector objs;
boolean changed;
java.awt.Rectangle tmp;
int id;
fkhSprite sprite;
int mode;
void makeClone();
void dirty();
boolean isDirty();
void clean();
public int which(int, int);
public void Drag(int, int, int);
fkhSprite addImage(int, int, int, int, java.awt.Image,
java.awt.Color);
fkhSprite fillOval(int, int, int, int, java.awt.Color);
void drawCircuits(int, int, int, int, java.awt.Color);
void flush();
void setMode(int);
int getColor(int, int);
void operate(fkhSprite, int);
void fkhStage(int, int);
}
image.classpublicsynchronizedclass image extends
java.applet.Applet {
static boolean free;
int yOffset;
double time;
double ts;
java.awt.Dimension area;
java.awt.Image bgImage;
java.awt.Image fgImage;
java.awt.Graphics gb;
java.awt.Graphics g;
java.awt.Color bgColor;
boolean running;
boolean rightClick;
boolean dragging;
int xs;
int ys;
int id;
java.awt.FontMetrics fm;
int chy;
fkhStage stage;
java.awt.Image img;
int xc;
int yc;
int dr;
int xx;
int yy;
int size;
int size2;
int xp;
int yp;
double r1;
double r2;
public void init();
public boolean action(java.awt.Event, Object);
public void reset(boolean);
String d2String(double);
public boolean mouseDown(java.awt.Event, int, int);
public boolean mouseDrag(java.awt.Event, int, int);
public boolean mouseUp(java.awt.Event, int, int);
void clear();
public void paint(java.awt.Graphics);
public void update(java.awt.Graphics);
public void image();
static void <clinit>();
}
rgbLight.classpublicsynchronizedclass rgbLight extends
java.applet.Applet {
staticfinal int PAINT = 1;
staticfinal int LIGHT = 0;
static boolean free;
int yOffset;
java.awt.Dimension area;
java.awt.Image bgImage;
java.awt.Image fgImage;
java.awt.Graphics gb;
java.awt.Graphics g;
java.awt.TextField[] tf;
java.awt.Label lbr;
java.awt.Label lbg;
java.awt.Label lbb;
java.awt.Label ltype;
String rts;
String[] STR;
java.awt.Color bgColor;
boolean rightClick;
boolean dragging;
int xs;
int ys;
int id;
java.awt.FontMetrics fm;
int chy;
fkhStage stage;
fkhSprite[] OBJ;
java.awt.Image img;
int xc;
int yc;
int dr;
int xx;
int yy;
int size;
int size2;
java.awt.Color[] clr1;
java.awt.Color[] clr2;
java.awt.Color[] clr;
int mode;
int N;
int xp;
int yp;
double r1;
double r2;
public void init();
public boolean action(java.awt.Event, Object);
int cValue(java.awt.TextField);
String d2String(double);
public boolean mouseDown(java.awt.Event, int, int);
void showValue();
public boolean mouseDrag(java.awt.Event, int, int);
public boolean mouseUp(java.awt.Event, int, int);
public boolean mouseMove(java.awt.Event, int, int);
void showRGB(int, int);
void setMode(int);
void clear();
public void paint(java.awt.Graphics);
public void update(java.awt.Graphics);
public void rgbLight();
static void <clinit>();
}
ripple.classpublicsynchronizedclass ripple extends
java.applet.Applet {
static boolean free;
int yOffset;
double time;
double ts;
java.awt.Dimension area;
java.awt.Image bgImage;
java.awt.Image fgImage;
java.awt.Graphics gb;
java.awt.Graphics g;
java.awt.Color bgColor;
boolean rightClick;
boolean dragging;
int xs;
int ys;
java.awt.FontMetrics fm;
int chy;
fkhStage stage;
java.awt.Image img;
int xc;
int yc;
int dr;
int xx;
int yy;
int size;
int size2;
int xp;
int yp;
double r1;
double r2;
public void init();
String d2String(double);
public boolean mouseDown(java.awt.Event, int, int);
public boolean mouseDrag(java.awt.Event, int, int);
public boolean mouseUp(java.awt.Event, int, int);
void clear();
public void paint(java.awt.Graphics);
public void update(java.awt.Graphics);
public void ripple();
static void <clinit>();
}
back.gif
rgb.gif
index.html
標題
起頭
使用說明:
物理解說:
歡迎批評指教! 電子郵件 : 請按
[email protected]作者:國立台灣師範大學物理系黃福坤最後修訂時間:
rgbLight.javargbLight.javaimport java.awt.*;
import java.awt.image.*;
import java.util.*;
publicclass rgbLight extends java.applet.Applet{// implements
Runnable{
int yOffset=40;
Dimension area;
Image bgImage,fgImage;
Graphics gb,g;//background drawing
// Color bgColor=Color.cyan;//white;//cyan;//lightGray;
// String tfl[]={"R","G","B"};
TextField tf[]=newTextField[3];
Label lbr,lbg,lbb,ltype;
String rts,STR[]={"R","G","B","MSG1","MSG2"};
Color bgColor=newColor(0xC8,0xDF,0xD0);
publicvoid init(){
for(int i=0;i<STR.length;i++){
if((rts=getParameter(STR[i]))!=null)
STR[i]=newString(rts);
}
setBackground(bgColor);
Panel p=newPanel();
p.add(ltype=newLabel(STR[3]+" "));
p.add(lbr=newLabel(" "));
lbr.setBackground(Color.red);
p.add(lbg=newLabel(" "));
lbg.setBackground(Color.green);
p.add(lbb=newLabel(" "));
for(int i=0;i<3;i++){
p.add(newLabel(STR[i]));
p.add(tf[i]=newTextField(2));
}
lbb.setBackground(Color.blue);
lbb.setForeground(Color.white);
add("North",p);
area=size();
clear();
}
publicboolean action(Event ev,Object arg){
if(id!=-1&& ev.target instanceofTextField){
try{
Color c=newColor(cValue(tf[0]),cValue(tf[1]),cValue(tf[2]));
clr[id]=c;
OBJ[id].setColor(c);
stage.dirty();
repaint();
}catch(NumberFormatException e){
showValue();
}
}
returntrue;
}
int cValue(TextField t){
int value=(int)Integer.parseInt(t.getText())%256;
t.setText(String.valueOf(value));
return value;
}
String d2String(double value){
float f=(float)((int)(value*10.)/10.);
String str=String.valueOf(f);
if(str.indexOf(".")==-1)str+=".0";
return str;
}
boolean rightClick=false,dragging=false;
int xs,ys,id;
publicboolean mouseDown(Event e,int x,int y){
if((y-=yOffset)<0)returnfalse;
if(e.modifiers==Event.META_MASK){//"Right Click, ";
rightClick=true;
if(e.clickCount==2){
if(mode==LIGHT)setMode(PAINT);
else setMode(LIGHT);
for(int i=0;i<N;i++)OBJ[i].setColor(clr[i]);
repaint();
showRGB(x, y);
}
}else{
rightClick=false;
dragging=true;
id=stage.which(x,y);
showValue();
}
xs=x;
ys=y;
returntrue;
}
void showValue(){
if(id!=-1)for(int i=0;i<STR.length;i++){
tf[0].setText(String.valueOf(clr[id].getRed()));
tf[1].setText(String.valueOf(clr[id].getGreen()));
tf[2].setText(String.valueOf(clr[id].getBlue()));
}
}
publicboolean mouseDrag(Event e,int x,int y){
if(!free ||(y-=yOffset)<0)returnfalse;
if(dragging){
stage.Drag(id,x-xs,y-ys);
xx+=x-xs;
yy+=y-ys;
repaint();
showRGB(x, y);
}
xs=x;
ys=y;
returntrue;
}
publicboolean mouseUp(Event e,int x,int y){
if((y-=yOffset)<0)returnfalse;
dragging=false;
returntrue;
}
publicboolean mouseMove(Event e,int x,int y){
if(dragging ||(y-=yOffset)<0)returnfalse;
showRGB(x,y);
returntrue;
}
void showRGB(int x,int y){
int value=stage.getColor(x,y);
Color c;
if(value==0)c=clr[3];
else c=newColor(value);
//clb.setText("("+c.getRed()+","+c.getGreen()+","+c.getBlue()+
")");
lbr.setText(String.valueOf(c.getRed()));
lbg.setText(String.valueOf(c.getGreen()));
lbb.setText(String.valueOf(c.getBlue()));
}
FontMetrics fm;
int chy;
fkhStage stage;
fkhSprite OBJ[]=new fkhSprite[3];
Image img;
int xc,yc,dr=6,xx,yy;
int size=2,size2=2*size;
Color clr1[]={Color.red,Color.green,Color.blue,Color.black};
Color clr2[]={Color.cyan,Color.magenta,Color.yellow,Color.wh
ite};
Color clr[];
finalstaticint PAINT=1,LIGHT=0;
int mode,N=OBJ.length;
void setMode(int newmode){
mode=newmode;
if(newmode==LIGHT){
clr=clr1;
stage.setMode(fkhStage.OR);
ltype.setText(STR[3]);
}else{
clr=clr2;
stage.setMode(fkhStage.AND);
ltype.setText(STR[4]);
}
gb.setColor(clr[N]);
gb.fillRect(0,0, area.width, area.height);
// gb.setColor(cs);
// gb.drawString(msg,5,chy);
}
void clear(){
if(g==null){
bgImage = createImage(area.width, area.height);
gb = bgImage.getGraphics();
fgImage = createImage(area.width, area.height);
g = fgImage.getGraphics();
fm=gb.getFontMetrics();
chy=fm.getHeight();
stage=new fkhStage(area.width,area.height);
xc=area.width/2;
yc=area.height/2;
//mode=LIGHT;
setMode(LIGHT);
// g.setColor(Color.red);
// g.fillOval(25,25,200,100);
// g.setColor(Color.yellow);
// g.fillOval(50,50,50,50);
// OBJ[0]=stage.addImage(5,5,200,100,fgImage,bgColor);
OBJ[0]=stage.fillOval(5,5,200,100,clr[0]);
OBJ[1]=stage.fillOval(xc,5,200,100,clr[1]);
OBJ[2]=stage.fillOval(xc-75,140,150,150,clr[2]);
}
// repaint();
}
publicvoid paint(Graphics gs){
update(gs);
}
staticboolean free=true;
int xp,yp;
double r1,r2;
publicvoid update(Graphics gs){
free=false;
g.drawImage(bgImage,0,0,this);
if(stage.isDirty()){
stage.flush();
img=createImage(newMemoryImageSource(stage.tmp.w
idth, stage.tmp.height, stage.pix,0, stage.tmp.width));
}
if(img!=null)g.drawImage(img,stage.tmp.x,stage.tmp.y,this);
gs.drawImage(fgImage,0, yOffset,this);
free=true;
}
}
ripple.javaripple.javaimport java.awt.*;
import java.awt.image.*;
import java.util.*;
publicclass ripple extends java.applet.Applet{
int yOffset=0;
double time=0.0,ts=0.;
Dimension area;
Image bgImage,fgImage;
Graphics gb,g;//background drawing
// Color bgColor=Color.cyan;//lightGray;
Color bgColor=newColor(0xC8,0xDF,0xD0);
publicvoid init(){
setBackground(bgColor);
area=size();
clear();
}
String d2String(double value){
float f=(float)((int)(value*10.)/10.);
String str=String.valueOf(f);
if(str.indexOf(".")==-1)str+=".0";
return str;
}
boolean rightClick=false,dragging=false;
int xs,ys;
publicboolean mouseDown(Event e,int x,int y){
if((y-=yOffset)<0)returnfalse;
if(e.modifiers==Event.META_MASK){//"Right Click, ";
rightClick=true;
dragging=true;
}else{
rightClick=false;
repaint();
}
xs=x;
ys=y;
returntrue;
}
publicboolean mouseDrag(Event e,int x,int y){
if(!free ||(y-=yOffset)<0)returnfalse;
if(dragging){
xx+=x-xs;
yy+=y-ys;
repaint();
}
xs=x;
ys=y;
returntrue;
}
publicboolean mouseUp(Event e,int x,int y){
if((y-=yOffset)<0)returnfalse;
dragging=false;
returntrue;
}
FontMetrics fm;
int chy;
fkhStage stage;
Image img;
int xc,yc,dr=6,xx,yy;
int size=2,size2=2*size;
void clear(){
if(g==null){
bgImage = createImage(area.width, area.height);
gb = bgImage.getGraphics();
fgImage = createImage(area.width, area.height);
g = fgImage.getGraphics();
fm=gb.getFontMetrics();
chy=fm.getHeight();
stage=new fkhStage(area.width,area.height);
xc=area.width/2;
yc=area.height/2;
xs=xc+12*dr;
ys=yc-20*dr;
}
gb.setColor(bgColor);
gb.fillRect(0,0, area.width, area.height);
Color clr=Color.darkGray;
gb.setColor(clr);//Color.black);
for(int i=0,xi=xc-dr,yi=yc-dr,dx=2*dr;xi>0;xi-=dr,yi-
=dr,dx+=2*dr)
gb.drawOval(xi,yi,dx,dx);
gb.setColor(Color.red);
gb.fillOval(xc-size,yc-size,size2,size2);
stage.drawCircuits(area.width,area.height,xc,xc/dr,clr);//C
olor.black);//magenta);//red);
xx=6*dr;
if(stage.isDirty()){
stage.flush();
img=createImage(newMemoryImageSource(stage.tmp.w
idth, stage.tmp.height, stage.pix,0, stage.tmp.width));
}
}
publicvoid paint(Graphics gs){
update(gs);
}
staticboolean free=true;
int xp,yp;
double r1,r2;
publicvoid update(Graphics gs){
free=false;
g.drawImage(bgImage,0,0,this);
if(img!=null)g.drawImage(img,xx,yy,this);
xp=xx+xc+1;
yp=yy+yc;
g.setColor(Color.red);
g.fillOval(xp-size,yp-size,size2,size2);
if(!dragging){
g.setColor(Color.blue);//yellow);
// g.drawLine(xp,yp,xc,yc);
g.drawLine(xc,yc,xs,ys);
g.drawLine(xp,yp,xs,ys);
r2=Math.sqrt((xp-xs)*(xp-xs)+(yp-ys)*(yp-ys))/dr;
r1=Math.sqrt((xc-xs)*(xc-xs)+(yc-ys)*(yc-ys))/dr;
g.drawString("r1 = "+d2String(r1)+", r2 = "+d2String(r
2)+
", r1-r2 = "+d2String(r1-r2),10,chy);
}
gs.drawImage(fgImage,0, yOffset,this);
free=true;
}
}
fkhStage.javafkhStage.javaimport java.awt.*;
import java.awt.image.*;
import java.util.*;
class fkhStage extends fkhSprite{
intNpts,count;
Vector objs=newVector();
boolean changed=false;
fkhStage(int w,int h){
super(w,h);
}
Rectangle tmp;
void makeClone(){
tmp=(Rectangle)objs.elementAt(0);
for(int i=1;i<count;i++)
tmp=tmp.union((Rectangle)objs.elementAt(i));
tmp=intersection(tmp);
pix=newint[tmp.width*tmp.height];
}
void dirty(){
changed=true;
}
boolean isDirty(){
return changed;
}
void clean(){
changed=false;
}
int id=-1;
fkhSprite sprite;
publicint which(int xi,int yi){
id=-1;
for(int i=0;i<count;i++){
sprite=(fkhSprite)objs.elementAt(i);
if(sprite.inside(xi,yi)){
id=i;
break;
}
}
return id;
}
publicvoidDrag(int i,int dx,int dy){
if(id!=-1){
sprite.x+=dx;
sprite.y+=dy;
dirty();
}
}
fkhSprite addImage(int xi,int yi,int w,int h,Image img,Color
bgColor){
fkhSprite member=new fkhSprite(xi,yi,w,h,img);
member.eraseBackground(bgColor);//transparent
objs.addElement(member);
dirty();
return member;
}
fkhSprite fillOval(int xi,int yi,int w,int h,Color c){
fkhSprite member=new fkhSprite(xi,yi,w,h,c);
member.fillOval();
objs.addElement(member);
dirty();
return member;
}
void drawCircuits(int w,int h,int ri,int N,Color c){
fkhSprite member=new fkhSprite(0,0,w,h);
member.Circles(ri/N,c);
objs.addElement(member);
dirty();
}
void flush(){
count=objs.size();
if(changed)makeClone();
elsereturn;
// if(objs==null)return;
operate((fkhSprite)objs.elementAt(0),COPY);
if(count>0)for(int i=1;i<count;i++){
operate((fkhSprite)objs.elementAt(i),mode);
}
clean();
}
int mode=OR;// or and
finalstaticint COPY=0,OR=1,AND=2;
void setMode(int newmode){
mode=newmode;
dirty();
}
int getColor(int dx,int dy){
if(tmp!=null&& inside(dx-=tmp.x,dy-
=tmp.y))return pix[dy*tmp.width+dx];
elsereturn0;
}
void operate(fkhSprite src,int mode){
int dd,id,xmin=0,xmax=src.width,ymin=0,ymax=src.height;
int id0,xmin0=0,xmax0=tmp.width,ymin0=0,ymax0=tmp.height;
int[] pixs=src.pix;
if(src.x>tmp.x) xmin0=src.x-tmp.x;
else xmin=tmp.x-src.x;
if(src.x+src.width>tmp.x+tmp.width)xmax=tmp.x+tmp.width-
src.x;
else xmax0=src.x+src.width-tmp.x;
if(src.y>tmp.y) ymin0=src.y-tmp.y;
else ymin=tmp.y-src.y;
if(src.y+src.height>tmp.y+tmp.height)ymax=tmp.y+tmp.height-
src.y;
else ymax0=src.y+src.height-tmp.y;
dd=(ymin0-ymin)*tmp.width+xmin0;
switch(mode){
case COPY:
for(int i=ymin;i<ymax;i++){
id0=i*tmp.width+dd;
id=i*src.width+xmin;
for(int j=xmin;j<xmax;j++){
pix[id0++]= pixs[id++];
// if(pixs[id]!=0)pix[id0++] =pixs[id++] ;
}
}
break;
case OR:
for(int i=ymin;i<ymax;i++){
id0=i*tmp.width+dd;
id=i*src.width+xmin;
for(int j=xmin;j<xmax;j++){
pix[id0++]|= pixs[id++];
}
}
break;
case AND:
for(int i=ymin;i<ymax;i++){
id0=i*tmp.width+dd;
id=i*src.width+xmin;
for(int j=xmin;j<xmax;j++,id0++,id++){
if(pix[id0]==0) pix[id0]= pixs[id];
elseif(pixs[id]!=0)pix[id0]&= pixs[id];
}
}
break;
}
}
}
class fkhSprite extendsRectangle{
int[] pix;
int index,color=0;
fkhSprite(int w,int h){
x=y=0;
width=w;
height=h;
}
fkhSprite(int xi,int yi,int w,int h){
init(xi,yi,w,h);
}
fkhSprite(int xi,int yi,int w,int h,Color c){
init(xi,yi,w,h,c);
}
/* How to use this
Image img=createImage(width,height); // in applets
Graphics g=sprite.getGraphic();
g.setColor(Color.yellow); g.fillOval(x,y,w,h);//drawing work
s
fkhSprite sprite=new fkhSprite(x,y,w,h,img);
*/
fkhSprite(int xi,int yi,int w,int h,Image img){
init(xi,yi,w,h);
PixelGrabber pg =newPixelGrabber(img, x, y, w, h, pix,0, w);
try{
pg.grabPixels();
}catch(InterruptedException e){
System.err.println("interrupted waiting for pixels!");
return;
}
}
void init(int xi,int yi,int w,int h){
x=xi;
y=yi;
width=w;
height=h;
pix=newint[w*h];
}
void init(int xi,int yi,int w,int h,Color c){
init(xi,yi,w,h);
index=0;
color=c.getRGB();
for(int i=0;i<height;i++)
for(int j=0;j<width;j++)pix[index++]=color;
}
void setColor(Color c){
setColor(c.getRGB());
}
void setColor(int value){
int N=width*height;
for(int i=0;i<N;i++)
if(pix[i]!=0)pix[i]=value;
}
void transparent(Color bgColor){
int value=bgColor.getRGB();
int N=width*height,code=0xFFFFFF;
for(int i=0;i<N;i++)
if(pix[i]==value)pix[i]&=code;
}
void eraseBackground(Color bgColor){
int value=bgColor.getRGB();
int N=width*height;
for(int i=0;i<N;i++)
if(pix[i]==value)pix[i]=0;
}
void fillOval(){
double w=width/2.,h=height/2.,w2=w*w,h2=h*h;
int wi=(int)w,hi=(int)h,ww=width-1,hh=height-1,
dd=hh*width;
for(int i=0;i<hi;i++){
for(int j=0;j<wi;j++){
if((i-h)*(i-h)/h2+(j-w)*(j-w)/w2>1.){
index=i*width;
pix[index+j]=0;
pix[index+ww-j]=0;
index=dd-index;
pix[index+j]=0;
pix[index+ww-j]=0;
}elsebreak;
}
}
}
finalstaticdouble PI2=Math.PI/2.;
voidCircles(int dr,Color clr){
double dc,cmax;
int xc=width/2,yc=height/2,r;
int xx,yy,color=clr.getRGB(),id0=yc*width+xc,id;
intNmax=width*height;
for(r=dr;r<xc;r+=dr){
dc=1./r;
cmax=PI2*r+dc;
for(double c=0.;c<PI2;c+=dc){
xx=(int)(r*Math.cos(c));
yy=(int)(r*Math.sin(c));
//if(xx<xc && yy<yc){
if((id=id0+yy*width+xx)<Nmax){
pix[id]=color;
pix[id-=2*xx]=color;
if((id-=2*yy*width)>0){
pix[id]=color;
pix[id+=2*xx]=color;
}
}
}
}
}
}
Prism: Reflection and Refraction
Web Site:
http://www.phy.ntnu.edu.tw/java/optics/prism_e.html
Introduction:
This Java applet let you play with a light source and a prism, to
study the physics of light.
Both reflection and refraction occur at the interface between
two media. (Even total internal reflection might also occur.)
Light will travel with different speed through different media,
which will result in both reflection and refraction.
For reflection: the angle of incidence is equal to angle of
reflection.
For refraction: Snell's law governs the angle
index of refraction for media 1 = n1; angle of incidence = 1
index of refraction for media 2 = n2; angle of refraction = 2
Snell’s Law: n1 sin 1 = n2 sin 2
Part of the energy is reflected and the rest propagate into new
media. This ratio depends on incident angle and index of
refraction (refracted angle).
Usage of this Applet:
Click the red region to change the light direction.
Click another region of light source and you can move the light
pen to different locations (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 terminate when the ray intensity
is less than 0.4%.
The relative intensity for each ray is shown at the boundary.
The index of refraction for the prism is initially set at 1.5
Instructions:
1. Load up the Java Lab from the web site shown above.
2. Establish a new prism shape if you want, but keep it
generally the shape of what was is displayed at the start of this
experiment.
3. Change the index of refraction of the prism (n2) from 1.5
to 1.0 in increments of 0.1. Sketch the light rays for each value
of the index of refraction.
4. Reset the prism’s index of refraction (n2) back to 1.5.
5. For three different angles of incidence (either change the
shape of the prism, or move the light source around), use a
protractor to measure the angle of incidence of the light ray and
the corresponding angle of refraction. (Remember that both of
these angles are measured from the “normal”, i.e., the line
perpendicular to the surface at the point of incidence.)
6. Record your data, and compare your results to Snell’s Law.
(Assume that the angle of incidence is measured correctly, and
compare the angles of refraction.)
7. List all sources of error (and there should be plenty of
them).
8. Finally, write the report with your favorite word processor
or text editor and submit is to the instructor.
Use the “Sample Laboratory Report” as a guide in preparing
your lab report.
Any problems – please e-mail me. Also if you have any
complaints, comments, suggestions, or kudos concerning this
experiment, please e-mail me. It won’t help your class, but I
will take them into consideration for the next time this course is
offered.

More Related Content

Similar to How to Allow Java Applets for physics labsWindows 7Ope.docx

Measuring team performance with Polls
Measuring team performance with PollsMeasuring team performance with Polls
Measuring team performance with PollsPeter Rainey
 
US Youth Soccer Practice Activities (U6-U8)
US Youth Soccer Practice Activities (U6-U8)US Youth Soccer Practice Activities (U6-U8)
US Youth Soccer Practice Activities (U6-U8)Matthew Pearson
 
Coaches as extrinsic motivators and supporter of intrinsic development
Coaches as extrinsic motivators and supporter of intrinsic developmentCoaches as extrinsic motivators and supporter of intrinsic development
Coaches as extrinsic motivators and supporter of intrinsic developmentJeremyStephens103
 
Broomfield Recreation Services Coaches Training
Broomfield Recreation Services Coaches TrainingBroomfield Recreation Services Coaches Training
Broomfield Recreation Services Coaches Trainingbroomfieldrecreation
 
Emerging Learning and Development Models: Part Four
Emerging Learning and Development Models: Part FourEmerging Learning and Development Models: Part Four
Emerging Learning and Development Models: Part FourSahil Parikh
 
Reardon-Schall-#6 (FINAL)
Reardon-Schall-#6 (FINAL)Reardon-Schall-#6 (FINAL)
Reardon-Schall-#6 (FINAL)Samantha Schall
 
Terry Liskevych on Coaching Volleyball
Terry Liskevych on Coaching VolleyballTerry Liskevych on Coaching Volleyball
Terry Liskevych on Coaching VolleyballPatrick Kohan
 
The Language of Coaching - Football (Soccer)
The Language of Coaching - Football (Soccer)The Language of Coaching - Football (Soccer)
The Language of Coaching - Football (Soccer)Nick Winkelman, PhD
 
P.E.-PPT (1).pptx Physical Education_grade 12_2nd semester
P.E.-PPT (1).pptx Physical Education_grade 12_2nd semesterP.E.-PPT (1).pptx Physical Education_grade 12_2nd semester
P.E.-PPT (1).pptx Physical Education_grade 12_2nd semesterErikaMaeTadeo
 
Fabulous How To Write A Good Conclusion For An Analysis Essa
Fabulous How To Write A Good Conclusion For An Analysis EssaFabulous How To Write A Good Conclusion For An Analysis Essa
Fabulous How To Write A Good Conclusion For An Analysis EssaLisa Netkowicz
 
Athlete Builder Assistant Coach Reference Guide -Section 7
Athlete Builder Assistant Coach Reference Guide -Section 7Athlete Builder Assistant Coach Reference Guide -Section 7
Athlete Builder Assistant Coach Reference Guide -Section 7athletebuilder
 
Standard Grade Activities
Standard Grade ActivitiesStandard Grade Activities
Standard Grade ActivitiesPEEDC
 
info processing system
info processing systeminfo processing system
info processing systemclairemcaulay
 

Similar to How to Allow Java Applets for physics labsWindows 7Ope.docx (16)

Measuring team performance with Polls
Measuring team performance with PollsMeasuring team performance with Polls
Measuring team performance with Polls
 
Poe training
Poe trainingPoe training
Poe training
 
US Youth Soccer Practice Activities (U6-U8)
US Youth Soccer Practice Activities (U6-U8)US Youth Soccer Practice Activities (U6-U8)
US Youth Soccer Practice Activities (U6-U8)
 
Pe11.4 (1)
Pe11.4 (1)Pe11.4 (1)
Pe11.4 (1)
 
Coaches as extrinsic motivators and supporter of intrinsic development
Coaches as extrinsic motivators and supporter of intrinsic developmentCoaches as extrinsic motivators and supporter of intrinsic development
Coaches as extrinsic motivators and supporter of intrinsic development
 
Broomfield Recreation Services Coaches Training
Broomfield Recreation Services Coaches TrainingBroomfield Recreation Services Coaches Training
Broomfield Recreation Services Coaches Training
 
Emerging Learning and Development Models: Part Four
Emerging Learning and Development Models: Part FourEmerging Learning and Development Models: Part Four
Emerging Learning and Development Models: Part Four
 
Reardon-Schall-#6 (FINAL)
Reardon-Schall-#6 (FINAL)Reardon-Schall-#6 (FINAL)
Reardon-Schall-#6 (FINAL)
 
Factor affecting performance
Factor affecting performanceFactor affecting performance
Factor affecting performance
 
Terry Liskevych on Coaching Volleyball
Terry Liskevych on Coaching VolleyballTerry Liskevych on Coaching Volleyball
Terry Liskevych on Coaching Volleyball
 
The Language of Coaching - Football (Soccer)
The Language of Coaching - Football (Soccer)The Language of Coaching - Football (Soccer)
The Language of Coaching - Football (Soccer)
 
P.E.-PPT (1).pptx Physical Education_grade 12_2nd semester
P.E.-PPT (1).pptx Physical Education_grade 12_2nd semesterP.E.-PPT (1).pptx Physical Education_grade 12_2nd semester
P.E.-PPT (1).pptx Physical Education_grade 12_2nd semester
 
Fabulous How To Write A Good Conclusion For An Analysis Essa
Fabulous How To Write A Good Conclusion For An Analysis EssaFabulous How To Write A Good Conclusion For An Analysis Essa
Fabulous How To Write A Good Conclusion For An Analysis Essa
 
Athlete Builder Assistant Coach Reference Guide -Section 7
Athlete Builder Assistant Coach Reference Guide -Section 7Athlete Builder Assistant Coach Reference Guide -Section 7
Athlete Builder Assistant Coach Reference Guide -Section 7
 
Standard Grade Activities
Standard Grade ActivitiesStandard Grade Activities
Standard Grade Activities
 
info processing system
info processing systeminfo processing system
info processing system
 

More from wellesleyterresa

Hw059f6dbf-250a-4d74-8f5e-f28f14227edc.jpg__MACOSXHw._059.docx
Hw059f6dbf-250a-4d74-8f5e-f28f14227edc.jpg__MACOSXHw._059.docxHw059f6dbf-250a-4d74-8f5e-f28f14227edc.jpg__MACOSXHw._059.docx
Hw059f6dbf-250a-4d74-8f5e-f28f14227edc.jpg__MACOSXHw._059.docxwellesleyterresa
 
HW in teams of 3 studentsAn oil remanufacturing company uses c.docx
HW in teams of 3 studentsAn oil remanufacturing company uses c.docxHW in teams of 3 studentsAn oil remanufacturing company uses c.docx
HW in teams of 3 studentsAn oil remanufacturing company uses c.docxwellesleyterresa
 
HW 5.docxAssignment 5 – Currency riskYou may do this assig.docx
HW 5.docxAssignment 5 – Currency riskYou may do this assig.docxHW 5.docxAssignment 5 – Currency riskYou may do this assig.docx
HW 5.docxAssignment 5 – Currency riskYou may do this assig.docxwellesleyterresa
 
HW#3 – Spring 20181. Giulia is traveling from Italy to China. .docx
HW#3 – Spring 20181. Giulia is traveling from Italy to China. .docxHW#3 – Spring 20181. Giulia is traveling from Italy to China. .docx
HW#3 – Spring 20181. Giulia is traveling from Italy to China. .docxwellesleyterresa
 
HW 2Due July 1 by 500 PM.docx
HW 2Due July 1 by 500 PM.docxHW 2Due July 1 by 500 PM.docx
HW 2Due July 1 by 500 PM.docxwellesleyterresa
 
HW 4 Gung Ho Commentary DUE Thursday, April 20 at 505 PM on.docx
HW 4 Gung Ho Commentary DUE Thursday, April 20 at 505 PM on.docxHW 4 Gung Ho Commentary DUE Thursday, April 20 at 505 PM on.docx
HW 4 Gung Ho Commentary DUE Thursday, April 20 at 505 PM on.docxwellesleyterresa
 
HW 5 Math 405. Due beginning of class – Monday, 10 Oct 2016.docx
HW 5 Math 405. Due beginning of class – Monday, 10 Oct 2016.docxHW 5 Math 405. Due beginning of class – Monday, 10 Oct 2016.docx
HW 5 Math 405. Due beginning of class – Monday, 10 Oct 2016.docxwellesleyterresa
 
HW 5-RSAascii2str.mfunction str = ascii2str(ascii) .docx
HW 5-RSAascii2str.mfunction str = ascii2str(ascii)        .docxHW 5-RSAascii2str.mfunction str = ascii2str(ascii)        .docx
HW 5-RSAascii2str.mfunction str = ascii2str(ascii) .docxwellesleyterresa
 
HW 3 Project Control• Status meeting agenda – shows time, date .docx
HW 3 Project Control• Status meeting agenda – shows time, date .docxHW 3 Project Control• Status meeting agenda – shows time, date .docx
HW 3 Project Control• Status meeting agenda – shows time, date .docxwellesleyterresa
 
HW 1January 19 2017Due back Jan 26, in class.1. (T.docx
HW 1January 19 2017Due back Jan 26, in class.1. (T.docxHW 1January 19 2017Due back Jan 26, in class.1. (T.docx
HW 1January 19 2017Due back Jan 26, in class.1. (T.docxwellesleyterresa
 
Hussam Malibari Heckman MAT 242 Spring 2017Assignment Chapte.docx
Hussam Malibari Heckman MAT 242 Spring 2017Assignment Chapte.docxHussam Malibari Heckman MAT 242 Spring 2017Assignment Chapte.docx
Hussam Malibari Heckman MAT 242 Spring 2017Assignment Chapte.docxwellesleyterresa
 
hw1.docxCS 211 Homework #1Please complete the homework problem.docx
hw1.docxCS 211 Homework #1Please complete the homework problem.docxhw1.docxCS 211 Homework #1Please complete the homework problem.docx
hw1.docxCS 211 Homework #1Please complete the homework problem.docxwellesleyterresa
 
HUS 335 Interpersonal Helping SkillsCase Assessment FormatT.docx
HUS 335 Interpersonal Helping SkillsCase Assessment FormatT.docxHUS 335 Interpersonal Helping SkillsCase Assessment FormatT.docx
HUS 335 Interpersonal Helping SkillsCase Assessment FormatT.docxwellesleyterresa
 
HW #1Tech Alert on IT & Strategy (Ch 3-5Ch 3 -5 IT Strategy opt.docx
HW #1Tech Alert on IT & Strategy (Ch 3-5Ch 3 -5 IT Strategy opt.docxHW #1Tech Alert on IT & Strategy (Ch 3-5Ch 3 -5 IT Strategy opt.docx
HW #1Tech Alert on IT & Strategy (Ch 3-5Ch 3 -5 IT Strategy opt.docxwellesleyterresa
 
HW 2 (1) Visit Monsanto (httpwww.monsanto.com) again and Goog.docx
HW 2 (1) Visit Monsanto (httpwww.monsanto.com) again and Goog.docxHW 2 (1) Visit Monsanto (httpwww.monsanto.com) again and Goog.docx
HW 2 (1) Visit Monsanto (httpwww.monsanto.com) again and Goog.docxwellesleyterresa
 
Hunters Son Dialogue Activity1. Please write 1-2 sentences for e.docx
Hunters Son Dialogue Activity1. Please write 1-2 sentences for e.docxHunters Son Dialogue Activity1. Please write 1-2 sentences for e.docx
Hunters Son Dialogue Activity1. Please write 1-2 sentences for e.docxwellesleyterresa
 
HW 2 - SQL The database you will use for this assignme.docx
HW 2 - SQL   The database you will use for this assignme.docxHW 2 - SQL   The database you will use for this assignme.docx
HW 2 - SQL The database you will use for this assignme.docxwellesleyterresa
 
Humanities Commons Learning Goals1. Write about primary and seco.docx
Humanities Commons Learning Goals1. Write about primary and seco.docxHumanities Commons Learning Goals1. Write about primary and seco.docx
Humanities Commons Learning Goals1. Write about primary and seco.docxwellesleyterresa
 
HURRICANE KATRINA A NATION STILL UNPREPARED .docx
HURRICANE KATRINA  A NATION STILL UNPREPARED   .docxHURRICANE KATRINA  A NATION STILL UNPREPARED   .docx
HURRICANE KATRINA A NATION STILL UNPREPARED .docxwellesleyterresa
 
Humanities 115Short Essay Grading CriteriaExcellentPassing.docx
Humanities 115Short Essay Grading CriteriaExcellentPassing.docxHumanities 115Short Essay Grading CriteriaExcellentPassing.docx
Humanities 115Short Essay Grading CriteriaExcellentPassing.docxwellesleyterresa
 

More from wellesleyterresa (20)

Hw059f6dbf-250a-4d74-8f5e-f28f14227edc.jpg__MACOSXHw._059.docx
Hw059f6dbf-250a-4d74-8f5e-f28f14227edc.jpg__MACOSXHw._059.docxHw059f6dbf-250a-4d74-8f5e-f28f14227edc.jpg__MACOSXHw._059.docx
Hw059f6dbf-250a-4d74-8f5e-f28f14227edc.jpg__MACOSXHw._059.docx
 
HW in teams of 3 studentsAn oil remanufacturing company uses c.docx
HW in teams of 3 studentsAn oil remanufacturing company uses c.docxHW in teams of 3 studentsAn oil remanufacturing company uses c.docx
HW in teams of 3 studentsAn oil remanufacturing company uses c.docx
 
HW 5.docxAssignment 5 – Currency riskYou may do this assig.docx
HW 5.docxAssignment 5 – Currency riskYou may do this assig.docxHW 5.docxAssignment 5 – Currency riskYou may do this assig.docx
HW 5.docxAssignment 5 – Currency riskYou may do this assig.docx
 
HW#3 – Spring 20181. Giulia is traveling from Italy to China. .docx
HW#3 – Spring 20181. Giulia is traveling from Italy to China. .docxHW#3 – Spring 20181. Giulia is traveling from Italy to China. .docx
HW#3 – Spring 20181. Giulia is traveling from Italy to China. .docx
 
HW 2Due July 1 by 500 PM.docx
HW 2Due July 1 by 500 PM.docxHW 2Due July 1 by 500 PM.docx
HW 2Due July 1 by 500 PM.docx
 
HW 4 Gung Ho Commentary DUE Thursday, April 20 at 505 PM on.docx
HW 4 Gung Ho Commentary DUE Thursday, April 20 at 505 PM on.docxHW 4 Gung Ho Commentary DUE Thursday, April 20 at 505 PM on.docx
HW 4 Gung Ho Commentary DUE Thursday, April 20 at 505 PM on.docx
 
HW 5 Math 405. Due beginning of class – Monday, 10 Oct 2016.docx
HW 5 Math 405. Due beginning of class – Monday, 10 Oct 2016.docxHW 5 Math 405. Due beginning of class – Monday, 10 Oct 2016.docx
HW 5 Math 405. Due beginning of class – Monday, 10 Oct 2016.docx
 
HW 5-RSAascii2str.mfunction str = ascii2str(ascii) .docx
HW 5-RSAascii2str.mfunction str = ascii2str(ascii)        .docxHW 5-RSAascii2str.mfunction str = ascii2str(ascii)        .docx
HW 5-RSAascii2str.mfunction str = ascii2str(ascii) .docx
 
HW 3 Project Control• Status meeting agenda – shows time, date .docx
HW 3 Project Control• Status meeting agenda – shows time, date .docxHW 3 Project Control• Status meeting agenda – shows time, date .docx
HW 3 Project Control• Status meeting agenda – shows time, date .docx
 
HW 1January 19 2017Due back Jan 26, in class.1. (T.docx
HW 1January 19 2017Due back Jan 26, in class.1. (T.docxHW 1January 19 2017Due back Jan 26, in class.1. (T.docx
HW 1January 19 2017Due back Jan 26, in class.1. (T.docx
 
Hussam Malibari Heckman MAT 242 Spring 2017Assignment Chapte.docx
Hussam Malibari Heckman MAT 242 Spring 2017Assignment Chapte.docxHussam Malibari Heckman MAT 242 Spring 2017Assignment Chapte.docx
Hussam Malibari Heckman MAT 242 Spring 2017Assignment Chapte.docx
 
hw1.docxCS 211 Homework #1Please complete the homework problem.docx
hw1.docxCS 211 Homework #1Please complete the homework problem.docxhw1.docxCS 211 Homework #1Please complete the homework problem.docx
hw1.docxCS 211 Homework #1Please complete the homework problem.docx
 
HUS 335 Interpersonal Helping SkillsCase Assessment FormatT.docx
HUS 335 Interpersonal Helping SkillsCase Assessment FormatT.docxHUS 335 Interpersonal Helping SkillsCase Assessment FormatT.docx
HUS 335 Interpersonal Helping SkillsCase Assessment FormatT.docx
 
HW #1Tech Alert on IT & Strategy (Ch 3-5Ch 3 -5 IT Strategy opt.docx
HW #1Tech Alert on IT & Strategy (Ch 3-5Ch 3 -5 IT Strategy opt.docxHW #1Tech Alert on IT & Strategy (Ch 3-5Ch 3 -5 IT Strategy opt.docx
HW #1Tech Alert on IT & Strategy (Ch 3-5Ch 3 -5 IT Strategy opt.docx
 
HW 2 (1) Visit Monsanto (httpwww.monsanto.com) again and Goog.docx
HW 2 (1) Visit Monsanto (httpwww.monsanto.com) again and Goog.docxHW 2 (1) Visit Monsanto (httpwww.monsanto.com) again and Goog.docx
HW 2 (1) Visit Monsanto (httpwww.monsanto.com) again and Goog.docx
 
Hunters Son Dialogue Activity1. Please write 1-2 sentences for e.docx
Hunters Son Dialogue Activity1. Please write 1-2 sentences for e.docxHunters Son Dialogue Activity1. Please write 1-2 sentences for e.docx
Hunters Son Dialogue Activity1. Please write 1-2 sentences for e.docx
 
HW 2 - SQL The database you will use for this assignme.docx
HW 2 - SQL   The database you will use for this assignme.docxHW 2 - SQL   The database you will use for this assignme.docx
HW 2 - SQL The database you will use for this assignme.docx
 
Humanities Commons Learning Goals1. Write about primary and seco.docx
Humanities Commons Learning Goals1. Write about primary and seco.docxHumanities Commons Learning Goals1. Write about primary and seco.docx
Humanities Commons Learning Goals1. Write about primary and seco.docx
 
HURRICANE KATRINA A NATION STILL UNPREPARED .docx
HURRICANE KATRINA  A NATION STILL UNPREPARED   .docxHURRICANE KATRINA  A NATION STILL UNPREPARED   .docx
HURRICANE KATRINA A NATION STILL UNPREPARED .docx
 
Humanities 115Short Essay Grading CriteriaExcellentPassing.docx
Humanities 115Short Essay Grading CriteriaExcellentPassing.docxHumanities 115Short Essay Grading CriteriaExcellentPassing.docx
Humanities 115Short Essay Grading CriteriaExcellentPassing.docx
 

Recently uploaded

Basic Intentional Injuries Health Education
Basic Intentional Injuries Health EducationBasic Intentional Injuries Health Education
Basic Intentional Injuries Health EducationNeilDeclaro1
 
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxOn_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxPooja Bhuva
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxCeline George
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024Elizabeth Walsh
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfDr Vijay Vishwakarma
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxPooja Bhuva
 
Tatlong Kwento ni Lola basyang-1.pdf arts
Tatlong Kwento ni Lola basyang-1.pdf artsTatlong Kwento ni Lola basyang-1.pdf arts
Tatlong Kwento ni Lola basyang-1.pdf artsNbelano25
 
How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17Celine George
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsMebane Rash
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...Nguyen Thanh Tu Collection
 
21st_Century_Skills_Framework_Final_Presentation_2.pptx
21st_Century_Skills_Framework_Final_Presentation_2.pptx21st_Century_Skills_Framework_Final_Presentation_2.pptx
21st_Century_Skills_Framework_Final_Presentation_2.pptxJoelynRubio1
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxRamakrishna Reddy Bijjam
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxheathfieldcps1
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentationcamerronhm
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the ClassroomPooky Knightsmith
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...Nguyen Thanh Tu Collection
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.MaryamAhmad92
 
latest AZ-104 Exam Questions and Answers
latest AZ-104 Exam Questions and Answerslatest AZ-104 Exam Questions and Answers
latest AZ-104 Exam Questions and Answersdalebeck957
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and ModificationsMJDuyan
 

Recently uploaded (20)

Basic Intentional Injuries Health Education
Basic Intentional Injuries Health EducationBasic Intentional Injuries Health Education
Basic Intentional Injuries Health Education
 
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxOn_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptx
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptx
 
Tatlong Kwento ni Lola basyang-1.pdf arts
Tatlong Kwento ni Lola basyang-1.pdf artsTatlong Kwento ni Lola basyang-1.pdf arts
Tatlong Kwento ni Lola basyang-1.pdf arts
 
How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
21st_Century_Skills_Framework_Final_Presentation_2.pptx
21st_Century_Skills_Framework_Final_Presentation_2.pptx21st_Century_Skills_Framework_Final_Presentation_2.pptx
21st_Century_Skills_Framework_Final_Presentation_2.pptx
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the Classroom
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
latest AZ-104 Exam Questions and Answers
latest AZ-104 Exam Questions and Answerslatest AZ-104 Exam Questions and Answers
latest AZ-104 Exam Questions and Answers
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 

How to Allow Java Applets for physics labsWindows 7Ope.docx

  • 1. How to Allow Java Applets for physics labs Windows 7 Open the lab Copy and paste the lab site given to desired internet browser Here I’m using google chrome, you can also use internet explorer or firefox, same results You will get a security warning click run. It may still not run… If it doesn’t run go the start menu on your computer. Type java. I click on the Java 32 bit under control panel. Once opened properly it should look like this. Click on the security tab, then click on edit site list
  • 2. Once the exception site list is up click add Type in the address given. Make sure to first type http:// you do not need the entire site just the main web site title for example http://phy.ntnu.edu.tw then click add It will say this is a risk, allow it (click continue) the school would not give you a website that gives you a virus. Now you are done. Simply reload your web page and you should be able to run the java applet. Note, we have used about 4 different lab sites that use java this means you have to do this for every new website. Coaching Principles Chapters 1-3 Coaching Philosophies, Coaching Objectives & Coaching Styles
  • 3. Developing Your Coaching Philosophy You have certain beliefs and principles Situations occur, events happen You respond based on your beliefs/principles You experience consequences Your beliefs change, adjust or solidify The Wildcat Scenario, Page 1 Coach Mitchell’s football Wildcats are down 14-10 with one minute to play. The fans scream as “Recordbook Rodney”, his star tailback, spins away from two tackles, dodges another, then lunges forward, tackled at the 6 yard line, just short of the end zone. Cheering teammates surround Rodney, who – unseen by the officials – throws a cheap shot to the kidney of his tackler. When Rodney gets to his feet, he spits toward the tackler, who is in obvious pain, and then glances to the sidelines to find Coach Mitchell’s eyes fixed on him. It’s obvious to both of them that his actions have flown square in the face of the team philosophy and rules. (Cont.) The Wildcat Scenario, Page 2 The refs call in the chains while the other team’s trainer assists the injured tackler. The crowd roars as the signal is given: first down and goal. Coach Mitchell calls a time out. Several players slap Rodney on the back as they run to the sidelines, and the PA announcer says, “This is it, Wildcat fans! Six yards away from the first playoff season in 15 years of Huntsville football.” Coach Mitchell is under tremendous pressure to return the Huntsville program to previous glory. Rodney has displayed flagrant and dangerous unsportsmanlike behavior, seen by the coach. What should Coach Mitchell do? What would you do if you were Coach Mitchell?
  • 4. Developing Your Philosophy Requires: Knowing yourself Reflection Self-Disclosure Your different “selves” Public Self Ideal Self Real Self Self-Esteem and Self-Disclosure How do you value yourself? Do you often judge yourself harshly? How much of yourself is known by others? How much of yourself is not known by others? How much of yourself is not known by you? How do you find out how others view you? Determining Your Coaching Objectives Goals of Coaches Usually Fall into Three Broad Categories Win Fun Develop the Athletes: Physically Psychologically Socially
  • 5. Assessing Your Objectives The best coaches are those who…Dev.FunWinGive individual help and are interested in athlete developmentMake practices and games funTeach athletes the skills needed to winIf a news story were written about meCoach who contributed to the dev of youngst.A coach for whom athletes enjoyed playingA winning coachAs a coach I emphasize…Teaching skills that young people can use later in lifeHaving funWinning What is the ASEP Philosophy? ASEP - American Sport Education Program Athletes First, Winning Second Vince Lombardi – Did he really say, “winning isn’t everything, it’s the only thing” ? Is “athletes first, winning second” realistic in today’s society? Your Personal Objectives Why do you want to coach? Can you balance winning, having fun, and developing the athlete? Are your coaching objectives compatible with the objectives of your program? Bill of Rights for Young Athletes The Right To: qualified adult leadership play as a child & not as an adult participate at an appropriate level, participate in a safe and healthy environment proper preparation
  • 6. share in the leadership and decision-making equal opportunity for success be treated with dignity have fun in sports Consider your goals Consider how you feel about “athletes first, winning second” Consider the emphasis you place on winning Consider the commitment it takes Consider the importance of ethical behavior in coaching So, As You Develop Your Philosophy Your Coaching Style Most coaches lean toward one of three coaching styles: Command – very coach-centered (dictator) Submissive – impact of the coach is minimal (babysitter) Cooperative – coach and athletes share in the decision making (teacher) Leadership in Coaching Regardless of your style, as a coach you must be a leader to be successful. There are 3 other key qualities of successful coaches: Knowledge of the sport Motivation Empathy Leaders:
  • 7. Provide direction Build a psychological and social environment that is conducive to achievement Instill values, in part by sharing their philosophy of life Motivate members of the group to pursue the goals of the group Confront group members when problems arrive and resolve conflicts Communicate What is Team Culture? Components of Team Culture Team Traditions Basic Operating Procedures Management of Information Nature of the Sport Power, influence, and status structure within the team Leadership style of the coach Build A Positive Team Culture Involve your athletes in defining team goals Give your athletes appropriate responsibilities Know your sport Treat each athlete with respect Be consistent with rewards and recognition of excellent performance and effort, not outcomes
  • 8. Coaching Code of Ethics National Standards for Sport Coaches: Standard 1 Develop an athlete- centered philosophy Standard 2 Identify, model, and teach positive values learned through sport participation Sample Lab Report: Please note: This is a fairly nice lab report of an experiment that should provide a guide to you for producing your own lab reports. Your report should usually contain the following ingredients: 1. Introduction of the purpose of the experiment 2. Description of the measurement procedure 3. Listing of the data you obtained, with formulas used in extraction of these data. 4. Graphic representation of your data and possible comparison to theoretical predictions 5. Discussion of possible errors and uncertainties
  • 9. 6. Conclusion with clearly stated outcomes of the experiment Experiment: Bouncing Golf Ball Introduction In this experiment we used the PASCO Science Workshop Equipment, KaliedaGraph, Microsoft Word and Excel, and a golf ball in order to investigate the potential, total, and kinetic energy of a ball that bounces off the ground. Our purpose is to determine as precisely as possible how much energy is lost in the bounce of the ball and to observe how well the energy is conserved throughout the flight. We believe that if the air resistance is neglected, then the ball that is dropped should conserve total energy as it falls. However, because the ground is not a totally elastic surface, some of the energy will be lost. We will therefore observe the total energy as a function of time so as to determine whether the energy is lost in the actual bounce of the ball into an inelastic surface, or due to air friction. Procedure First we needed to set up the equipment which contained a motion sensor and a golf ball. The golf ball was weighed and the height of the sensor, h, was measured with the digital meter on the sensor. The distance we are actually measuring, though, is the distance between the ground and the sensor because we are subtracting the distance from the motion sensor to the ball. We need to correct for the diameter of the ball because the distance from the motion sensor to the top of the ball is what the sensor is measuring, not the distance from the sensor to the ground. In order to do this we subtracted the diameter of the ball from h. Now that we were ready to begin the experiment, we held the ball below the sensor enough so its position is recorded and we began the recording and let the ball drop. After a few practice drops, we chose the ‘best’ data that allowed us to see a graph of d, the distance between the motion sensor and the ball versus
  • 10. time. A graph was created in Science Workshop displaying our data. More graphs and tables were then created. Data and Observations Formulas: Kinetic energy = ½ m v2 Potential energy = m g h Total energy = kinetic + potential energy Kinetic energy is the energy an object has while in motion. An object loses kinetic energy each time it hits a non-elastic surface. Kinetic energy is dependent upon the mass of the object and the velocity the object is moving with. The sharp decreases at t = 1.2 and 2.0 s are where the ball hit the ground. Potential energy is the possible amount of energy an object has before any movement. Potential energy is dependent upon the mass of the object, acceleration due to gravity and the height of the object. Each time the object falls it loses potential energy and each time it returns it gains potential energy. At t = 0.3, 1.2 and 2.0 s the ball hits the ground. This is because potential energy is lowest when the ball hits the ground. The total energy is the sum of both the kinetic and potential energy. At t = 0.3, 1.2, and 2.0 s the ball is striking the ground. We know this because at these times the ball has it’s lowest amount of energy. This is a step-like function because when the kinetic energy is at its peak, potential energy is at its valley, and vice versa. This creates horizontal lines when they are added.
  • 11. Conclusions Our purpose of the experiment was met because we were able to successfully investigate and observe kinetic, potential, and the total energy of a bouncing golf ball. From our observations, we are able to conclude that the ball loses energy each and every time the ball hits the ground and bounces back. This is especially noticeable in the graph of the total energy. In regards to air resistance versus elasticity, we concluded that the amount of energy lost through air resistance is negligible compared to the amount of energy lost through contact of the golf ball with the ground. During the motion of the ball, kinetic energy is not being conserved but rather distributed into the ground. This energy transfers because the ground is not an elastic surface. The total energy slightly decreases also due to the inelasticity of the bounce. The Law of Conservation of Energy does hold for this case, however, because the energy is not being destroyed rather it is being transferred. Each bounce created a total energy loss of approximately 0.9 J. The energy was lost in the actual bounce rather than in the air. This is because if the ball bounced on an elastic surface, the energy of each bounce would be roughly equal and the ball would return to its starting height. Because the experiment did not use a perfectly elastic surface, we can be fairly sure that the bounce was the actual cause of the loss of total energy, rather than the air resistance. Colors
  • 12. Web Site: http://www.phy.ntnu.edu.tw/java/image/rgbColor.htmlOR http://users.hal- pc.org/~clement/Simulations/Mixing%20Colors/rgbColor.html (Either website will work for this lab-please use whichever one loads for you!) Introduction: Thomas Young, in the early 1800s, showed that a broad range of colors can be generated by mixing three beams of light, provided their frequencies were widely separately. When three such beams combine to produce white light, they are called primary colors. There is no single unique set of these primaries, nor do they have to be made up of single (monochromatic) colors. The three components (emitted by three phosphors) that generate the whole gamut of hues as seen on a color TV set are Red, Green, and Blue. These are the primary colors. Looking through a colored window or cloth is another story. Yellow cloth, paper, dye, paint, and ink all selectively absorb blue, and reflect what remains – yellow. And that is why they appear yellow. When dealing with pigments (paints), the primary pigments are yellow, magenta (a light violet color), and cyan (a bluish-green hue). This Java applet let you play with mixing light beams and paint pigments.
  • 13. Instructions: 1. Load up the Java Lab from the web site shown above. 2. Click the right mouse button twice quickly to switch between two different modes: a. Mixing light beams (black background) b. Mixing paint pigments (white background) 3. Set the screen for mixing light beams. 4. Click the left mouse button and drag one of the colored ovals to move it around. 5. Determine what colors are obtained when two of the ovals intersect each other. Do this for all combinations of two ovals. 6. What color is obtained when the three ovals intersect each other? 7. Set the screen for mixing paint pigments. 8. Repeat steps 4 through 6 for paint pigments. 9. Finally, write the report telling what results were obtained in this experiment with your favorite word processor or text editor and submit is to the instructor. Use the “Sample Laboratory Report” as a guide in preparing your lab report. Any problems – please e-mail me. Also if you have any complaints, comments, suggestions, or kudos concerning this experiment, please e-mail me. It won’t help your class, but I
  • 14. will take them into consideration for the next time this course is offered Mirrors Web Site: http://www.phy.ntnu.edu.tw/java/Lens/lens_e.html Instructions: 1. Load up the Java Lab from the web site shown above. 2. Select “Mirror” 3. Press toggle button to “+” (if it’s not already shown) to indicate a converging (concave) mirror. 4. Press the “Reset” button. The value of p (the object’s location) should be 20.0, the value of q (the image location) should be 20.0, the value of f should be +10.0, and “Paraxial” should be checked) 5. Move the object (the blue arrow) to the following positions (p): 30.0, 25.0, 20.0, 15.0, 10.0, and 5.0. (Click near tip of the object, and drag it to where you want to place it, and then release the mouse button.) 6. For each position of the object, record the location of the image (q) and the type of image (real or virtual), as well as the magnification (M) of the image. 7. Plot a graph showing the object’s position (x-axis) versus the image position (y-axis). 8. Plot a graph of the object’s position (x-axis) versus the magnification (y-axis). 9. Press the toggle button to “-“ to indicate a diverging (convex) mirror.
  • 15. 10. Repeat steps 5 through 8 for this mirror. 11. Finally, write the report with your favorite word processor or text editor and submit is to the instructor. In this report discuss the effects produced when a mirror has a large curvature. Use the “Sample Laboratory Report” as a guide in preparing your lab report. Any problems – please e-mail me. Also if you have any complaints, comments, suggestions, or kudos concerning this experiment, please e-mail me. It won’t help your class, but I will take them into consideration for the next time this course is offered. optics/ABline.classsynchronizedclass ABline { static double eps; static double PI2; int xa; int ya; int xb; int yb; double ca; double cb; double m; double b; double index; double x; double y; double len; double cta; double alpha; double r12p;
  • 16. double r12s; boolean total; double rc; double twoPI; void draw(java.awt.Graphics); void translate(int, int); void setPoints(int, int, int, int); double angle(double, double, double, double); boolean touch(ray); ray reflection(ray); ray refraction(ray); void ABline(double); static void <clinit>(); } optics/box.classpublicsynchronizedclass box extends java.applet.Applet { double time; java.awt.Dimension area; java.awt.Image bgImage; java.awt.Image fgImage; java.awt.Graphics gb; java.awt.Graphics g; java.awt.Color bgColor; String rts; String[] STR; int xx; int yy; boolean rightClick; int size; int size2; int size4; int dragLight; boolean changed; int xs;
  • 17. int ys; java.awt.FontMetrics fm; int chy; int tx; int ty; int[] b; int xc; boolean display; java.awt.Point[] light; double len; double index; java.awt.Polygon hp; java.awt.Polygon tp; double PI6; double LEN; boolean showC; public void init(); String d2String(double); public boolean mouseDown(java.awt.Event, int, int); public boolean mouseDrag(java.awt.Event, int, int); public boolean mouseUp(java.awt.Event, int, int); public boolean mouseMove(java.awt.Event, int, int); void clear(boolean); public void paint(java.awt.Graphics); void drawPointer(java.awt.Point, java.awt.Point); public void update(java.awt.Graphics); void drawRay(double, double, double); public void box(); } optics/c1.gif optics/c2.gif optics/er.gif
  • 18. optics/esp.gif optics/eye.gif optics/eyescan.gif optics/fiber.classpublicsynchronizedclass fiber extends java.applet.Applet { double time; java.awt.Dimension area; java.awt.Image bgImage; java.awt.Image fgImage; java.awt.Graphics gb; java.awt.Graphics g; java.awt.Color bgColor; String rts; String[] STR; java.awt.TextField tf; int xs; int ys; boolean rightClick; boolean draghead; boolean dragtail; java.awt.FontMetrics fm; int chy; int x1; int y1; int y2; int xx; int yy; int dd; java.awt.Point head; java.awt.Point tail; double m; double b;
  • 19. double x; double y; double sc2; double tc2; double n; java.awt.Polygon hp; java.awt.Polygon tp; double PI6; double LEN; double cta; public void init(); public boolean action(java.awt.Event, Object); String d2String(double); public boolean mouseDown(java.awt.Event, int, int); public boolean mouseDrag(java.awt.Event, int, int); public boolean mouseUp(java.awt.Event, int, int); void clear(); public void paint(java.awt.Graphics); public void update(java.awt.Graphics); double drawIt(double, double, double); void drawPointer(java.awt.Point, java.awt.Point); public void fiber(); } optics/fish.swf optics/i.gif optics/ie.gif optics/image.classpublicsynchronizedclass image extends java.applet.Applet implements Runnable { java.awt.Dimension area; java.awt.Image bgImage; java.awt.Image fgImage;
  • 20. java.awt.Graphics gb; java.awt.Graphics g; java.awt.Color bgColor; String rts; String[] STR; int xx; int yy; int xs2; int ys2; boolean running; Thread animThread; long startTime; long lastTime; long delay; long delta; double c; int cnt; int ns; double xt; double yt; double bt; boolean rightClick; boolean dragm; boolean dragd; boolean dragd2; boolean down; int xs; int ys; double cta1; double cta2; double ctaa; double dd; double PI2; double m; int ni; int nf;
  • 21. int n; double V; double dc2; java.awt.FontMetrics fm; int chy; int xc; int yc; int size; int size2; int xm; int ym; int ym2; int Nmax; int NR; int Nmax1; double cta; double rm; double dc; double[] CR; double[] X; double[] Y; double[] VX; double[] VY; double cst; int NI; double[] PXA; double[] PYA; double[] PXB; double[] PYB; java.awt.Point na; java.awt.Point nb; public void init(); public void reset(); public void start(); public void stop(); public void run();
  • 22. void advanced(double); public boolean mouseDown(java.awt.Event, int, int); public boolean mouseDrag(java.awt.Event, int, int); void setupRay(); public boolean mouseUp(java.awt.Event, int, int); void clear(); public void paint(java.awt.Graphics); void imgs(double, double, double[], double[], java.awt.Point); public void update(java.awt.Graphics); public void image(); } optics/image_e.htmlMultiple Reflection from two plane mirrors Rays of lights are reflected from the mirror, each ray satisfying the law of reflection. It is fun to play with two plane mirrors, multiple images are formed. Would you like to try it with this java applet? The inverted moving fish (virtual image) is what the observer
  • 23. (fish on the left) will see underwater. When the moving fish is away from the observer, light emitter from the moving fish will be totally reflected at the water-air interface. So the water-air interface acting like a mirror. When the distance is too short for the total internal reflection to occurs, the virtual image above the water vanished. You can click and drag the observer left/right to change its location. More information will be shown when you drag the observer (fish).Why does a fish appear to be closer to the surface of water than it really is? The following java applet let you find out the answer, and learn the physics of refraction, and total internal reflection. [removed] [removed] Usage: A scanning eye represent the observer. You can click on it and drag it to any position you like.
  • 24. The whole screen will be clear when you drag the scanning eye. You can draw any pattern you like, and the java program will draw the virtual image of it. ( If the virtual can be formed due to refraction or total internal reflection) When you draw in the water region, the region where the total internal reflection is possible, will be shown. If you click the right mouse button, it will show you many light rays emitted. (including refraction rays and total internal reflection rays) Right click the mouse button twice is another way to clear the screen.to java applet This is an image You can draw any thing within the animation region, for example: the object shown in the above image. Light emitted from the object is refracted at the water and air interface.
  • 25. The observer trace back those refracted light to find the image of the object. The image appear closer to the water surface and its shape is different from the object. How to determine the location of the image (yellow dot) ? The world viewed under water is different from what we view it above the water surface. Drag the observer (eye) under the water and find out more interesting phenomena. Your suggestions are highly appreciated! Please click [email protected]Author¡GFu-Kwun Hwang, Dept. of physics, National Taiwan Normal University Last modified : More physics related java applets optics/point.classsynchronizedclass point { static java.awt.Graphics gb;
  • 26. static java.awt.Rectangle r; static double n; static int cnt; double x; double y; double vx; double vy; double v; double c; int status; void set(double, double, double, double); static void init(java.awt.Graphics, java.awt.Rectangle, double); point advanced(double); void point(double, double, double, double); } optics/prism.classpublicclass prism extends java.applet.Applet { double time; java.awt.Dimension area; java.awt.Image bgImage; java.awt.Image fgImage; java.awt.Graphics gb; java.awt.Graphics g; java.awt.Color bgColor; int xx; int yy; boolean rightClick; boolean movep; boolean dragt; boolean dragh; boolean dragp; int xs; int ys; boolean check;
  • 27. double[] C; double PI2; java.awt.FontMetrics fm; prisms p; int chy; int xa; java.awt.Rectangle box; java.awt.Point head; java.awt.Point tail; int N; int n; int N2; double V; ray light; double I; int size; int size2; double dist; double angle; java.awt.Polygon hp; java.awt.Polygon tp; double PI6; double cta; double ctaa; double c2a; double LEN; double maxI; int maxCnt; int Cnt; ABline AB; public void init(); public void reset(); String d2String(double); public boolean mouseDown(java.awt.Event, int, int); public boolean mouseDrag(java.awt.Event, int, int); public boolean mouseUp(java.awt.Event, int, int);
  • 28. public void changeIndex(double); void clear(); public void paint(java.awt.Graphics); public void update(java.awt.Graphics); void drawPointer(java.awt.Point, java.awt.Point); ray drawRay(ray); void drawTo(ray); ABline getTouch(ray); public void prism(); } optics/prisms.classclass prisms { int N; int N1; java.awt.Polygon P; int xc; int yc; double[] L; double[] C; double PI2; ABline[] AB; java.awt.Rectangle r; int size; int size2; double ax; double ay; double bx; double by; double ac; double dv; double c2a; int dragID; void prisms(int, int, double, double); void setXY(); void setLine(int);
  • 29. void drawPrism(java.awt.Graphics, java.awt.Color); void drawAngles(java.awt.Graphics, int, int); double angleAB(int, int, int); void fillPrism(java.awt.Graphics, java.awt.Color); void translate(int, int); boolean checkDrag(int, int); void drag(int, int); } optics/prism_e.html 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) [removed] [removed] [removed]
  • 30. 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
  • 31. 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:
  • 32. 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
  • 33. 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.to java applet Your suggestions are highly appreciated! Please click [email protected]Author:Fu-Kwun Hwang, Dept. of physics, National Taiwan Normal University Last modified : More physics related java applets optics/r12p.gif optics/r12s.gif optics/ray.classsynchronizedclass ray { double x;
  • 34. double y; double cta; double r; double p; boolean fromAir; double eps; java.awt.Color color(float); void setAngle(int, int, int, int); void setXY(int, int); double intensity(); void ray(int, int); void ray(); void ray(double, double, double, double, double, boolean); } optics/refraction.classpublicsynchronizedclass refraction extends java.applet.Applet implements Runnable { int yOffset; double time; java.awt.Dimension area; java.awt.Image bgImage; java.awt.Image fgImage; java.awt.Graphics gb; java.awt.Graphics g; java.awt.Color bgColor; String rts; String[] STR; int xx; int yy; boolean running; Thread animThread; long startTime; long lastTime; long delay; long delta;
  • 35. point p; boolean rightClick; java.awt.FontMetrics fm; int chy; int tx; int ty; int yc; int xp; int yp; int N; int ray2cnt; double n; point[] ray; point[] ray2; java.awt.Rectangle r; double vw; int size; int size2; public void init(); public boolean action(java.awt.Event, Object); public void reset(); String d2String(double); public void start(); public void stop(); public void run(); void advanced(double); public boolean mouseDown(java.awt.Event, int, int); public boolean mouseDrag(java.awt.Event, int, int); public boolean mouseUp(java.awt.Event, int, int); void clear(); public void paint(java.awt.Graphics); public void update(java.awt.Graphics); public void refraction(); }
  • 36. optics/shadow.classpublicsynchronizedclass shadow extends java.applet.Applet implements Runnable { double time; java.awt.Dimension area; java.awt.Image bgImage; java.awt.Image fgImage; java.awt.Graphics gb; java.awt.Graphics g; java.awt.Color bgColor; String rts; String[] STR; int xx; int yy; boolean running; Thread animThread; long startTime; long lastTime; long delay; long delta; boolean rightClick; boolean dragr; java.awt.FontMetrics fm; int chy; int tx; int ty; int x0; int y0; int size; int size2; int xc; java.awt.Rectangle r; java.awt.Rectangle s; double m; double b; double x1; double x2;
  • 37. double y1; double y2; public void init(); public boolean action(java.awt.Event, Object); public void reset(); String d2String(double); public void start(); public void stop(); public void run(); void advanced(double); public boolean mouseDown(java.awt.Event, int, int); public boolean mouseDrag(java.awt.Event, int, int); public boolean mouseUp(java.awt.Event, int, int); void clear(); public void paint(java.awt.Graphics); public void update(java.awt.Graphics); public void shadow(); } optics/shadow.html 標題 起頭 [removed] [removed] [removed] 使用說明:
  • 38. 物理解說:to java applet 歡迎批評指教! 電子郵件 : 請按 [email protected] 作者:國立台灣師範大學物理系黃福坤 最後修訂時間: rgbColor.htmlColorsThomas Young, in the early 1800s, showed that a broad range of colors can be generated by mixing three beams of light, provided their frequencies were widely separately. When three such beams combine to produce white light, there are called primary colors. There is no single unique set of these primaries, nor do they have to be monochromatic. The three components (emitted by three phoshors) that generate the whole gamut of hues seen on a color TV set are Red, Green, Blue. Looking through a colored window or cloth is another story. Yellow cloth, paper, dye, paint, and ink all selectively
  • 39. absorb blue and reflect what remains - yellow - and that is why they appear yellow. This java applet let you play with mixing light beams and paint pigments. [removed] [removed] [removed] [removed] [removed] Click the right mouse button twice quickly to switch between two different modes: ModebackgroundMixing light beamsblackMixing paint pigmentswhite Click left mouse button and drag one of the colored oval to move it around. Enter RGB values into the text field to change the color of the selected oval.
  • 40. The color code (RGB value) at the mouse tip are shown in colored background. Related Link: Director animation for mixing color/paint Your suggestions are highly appreciated! Please click [email protected]Author¡GFu-Kwun Hwang, Dept. of physics, National Taiwan Normal University Last modified : More physics related java applets rgbColor_kr.html 색토마스 영(Thomas Young)은 1800년대 초에 빛의 세 개의 빛의 조합으로 이루어져 있다는 것을 보여 주었다.(이 빛은 각각의 진동수에 따라 분리된다.) 이것을 빛의 3원색(primary colors)라고 부른다. 이것은 유일 집합도 아니고, 꼭 단파장일 필요도 없다. 이 세 요소는(세 위상에 의해서 발진한) 색상의 전영역을 만든다. 우리는 칼라 TV브라운관에서 이것을 확인할 수 있다.(빨강, 녹색, 파랑) 노란옷, 종이, 페인트, 잉크 등은 모두 선택적으로 다른색은 흡수하고, 남아 있는 것(노란색)은 반사한다. 그래서 우리는 노랗게 보는 것이다.
  • 41. 이 자바 애플릿은 빛의 혼합과 물감의 혼합을 직접해 볼 수 있다. [removed] [removed] [removed] [removed] [removed] 오른쪽 마우스 버튼으로 더블클릭하면, 두 모드가 서로 변환이 된다 모 드배경색빛의 혼합검은색물감의 혼합흰색 각 색깔의 타원은 왼쪽 마우스 버튼으로 드래그하여 위치를 이동시킬 수 있다. 각 타원의 색깔을 바꾸기 위해, RGB 값을 텍스트필드에 입력한다. 마우스 커서가 있는 위치의 색깔코드(RGB값)도 좌측상단에서 확인할 수 있다. 관계된 링크 : 빛과 물감의 혼합에 대한 디렉터 애니메이션 Your suggestions are highly appreciated! Please click [email protected] Author:Fu-Kwun Hwang, Dept. of physics, National Taiwan Normal University Translator : 신범철,
  • 42. SBC물리마을 Last modified : rgbLight.html 光色彩的疊加 與 塗料顏色混和 電視或電腦螢幕的各種繽紛的彩色 不過是三種基本顏色光點 俗稱三原光 『紅 綠 藍』 配合強度的變化組合而成。 想知道 電視或電腦所謂的三原光 是 如何組合成各式不同色彩的 光點嗎? 當 在畫紙上塗鴉時,不同顏色的顏料組合後 又呈現新的色彩。 所謂 三原色 『紅 黃 藍』 也可組成各種不同的色彩。 三原色中的『 紅藍』色彩 和 三原光中的『紅藍』色光 又有什麼不同呢? 其中的關係如何呢? 以下動畫 讓你玩一玩 『色光的疊加』與『色彩的混和』 [removed] [removed] [removed] [removed] [removed]
  • 43. 使用說明: 1. 首先你看到的是 黑色背景 光線的疊加。 三原光 『紅綠藍』 各以電腦螢幕所顯示的方式出現。 兩種光線重疊的部份則顯示出 另三種不同的色光。 三光線完全重疊處 則呈現白色。 一般電腦常將 三基本光線 強度分為 256種等級。 最弱為 0 最強則為255。則可以有 28*28*28 = 224 = 16M (1M約為一百萬)種組合。 當滑鼠在動畫區內移動時,上方 紅 綠 藍 方塊區域內會顯示 滑鼠所在位置 對應 電腦光點的 RGB數值。 以滑鼠左鍵分別點選 任一色光(點沒有重疊處會較清楚知道選的是誰) 上方 R G B 的空格會分別顯示所點選 色光 紅綠藍 RGB 分別的強度 你也可以輸入其他數值 (0-255間) 以更改 動畫中的色光顏色。 觀察組合結果有何不同!各種不同的組合將夠你好好的玩一下! 你能發現 疊加處的 RGB數值 和 個別色光RGB數值間的關係嗎? 2. 點選色光時若按住滑鼠 且移動滑鼠鍵 則可以改變該色光的位置。 3. 若快速按滑鼠右鍵 兩次,則背景將改為白色,動畫轉成 顏料的混和。
  • 44. 此時我所挑選的三原色 和 原來的三原光 有何特殊的關係? 同時注意 比較 三原色的混和區 、三原光 三原光的疊加區 、三原色 發現其間的關係了嗎? 顏色的混和時上面顯示的RGB數值又是怎樣的關係呢? 不同波長所對應約略的 RGB 數值 物理提示: 光線可以直接射入眼中或經過反射後 進入眼中。 塗料的顏色是 光線照射到塗料後,部份光線被吸收, 反射的光線則進入眼中後 呈現所看到的色彩。(類似於濾光片) 例如:紅色的顏料會吸收日光中大部份的綠光與藍光, 僅剩下紅光較能反射出來,因此看到紅色。 黑紙則幾乎吸收所有的入射光線。(並不見得完全吸收) 相關網頁 你所看到的色彩電燈泡的物理 歡迎批評指教! 電子郵件 : 請按 [email protected]作者:國立台灣師範大學物理系黃福坤最後修訂時間: ripple.html 波的干涉
  • 45. 以下是 兩組同心圓 用以表示 波動的 波前。 是否觀察到有一些 條紋的錯覺呢? 那些條紋與 波動的建設性干涉處是否相關呢? 使用說明: 在區域內按下滑鼠左鍵 將顯示兩波源分別到滑鼠的距離(以波長為單位)。 在同一道條紋內兩波源間的距離差 有何特殊之處呢? 按下滑鼠右鍵後拖動滑鼠 則可以移動其中一個波源的位置。 好好的玩一玩 同時觀察其中的規律性 ! 歡迎批評指教! 電子郵件 : 請按 [email protected]作者:國立台灣師範大學物理系黃福坤最後修訂時間: fkhSprite.classsynchronizedclass fkhSprite extends java.awt.Rectangle { staticfinal double PI2 = 1.5707963267948966; int[] pix; int index; int color; void init(int, int, int, int); void init(int, int, int, int, java.awt.Color); void setColor(java.awt.Color); void setColor(int); void transparent(java.awt.Color); void eraseBackground(java.awt.Color); void fillOval(); void Circles(int, java.awt.Color); void fkhSprite(int, int); void fkhSprite(int, int, int, int); void fkhSprite(int, int, int, int, java.awt.Color);
  • 46. void fkhSprite(int, int, int, int, java.awt.Image); } fkhStage.classsynchronizedclass fkhStage extends fkhSprite { staticfinal int COPY = 0; staticfinal int OR = 1; staticfinal int AND = 2; int Npts; int count; java.util.Vector objs; boolean changed; java.awt.Rectangle tmp; int id; fkhSprite sprite; int mode; void makeClone(); void dirty(); boolean isDirty(); void clean(); public int which(int, int); public void Drag(int, int, int); fkhSprite addImage(int, int, int, int, java.awt.Image, java.awt.Color); fkhSprite fillOval(int, int, int, int, java.awt.Color); void drawCircuits(int, int, int, int, java.awt.Color); void flush(); void setMode(int); int getColor(int, int); void operate(fkhSprite, int); void fkhStage(int, int); } image.classpublicsynchronizedclass image extends java.applet.Applet {
  • 47. static boolean free; int yOffset; double time; double ts; java.awt.Dimension area; java.awt.Image bgImage; java.awt.Image fgImage; java.awt.Graphics gb; java.awt.Graphics g; java.awt.Color bgColor; boolean running; boolean rightClick; boolean dragging; int xs; int ys; int id; java.awt.FontMetrics fm; int chy; fkhStage stage; java.awt.Image img; int xc; int yc; int dr; int xx; int yy; int size; int size2; int xp; int yp; double r1; double r2; public void init(); public boolean action(java.awt.Event, Object); public void reset(boolean); String d2String(double); public boolean mouseDown(java.awt.Event, int, int);
  • 48. public boolean mouseDrag(java.awt.Event, int, int); public boolean mouseUp(java.awt.Event, int, int); void clear(); public void paint(java.awt.Graphics); public void update(java.awt.Graphics); public void image(); static void <clinit>(); } rgbLight.classpublicsynchronizedclass rgbLight extends java.applet.Applet { staticfinal int PAINT = 1; staticfinal int LIGHT = 0; static boolean free; int yOffset; java.awt.Dimension area; java.awt.Image bgImage; java.awt.Image fgImage; java.awt.Graphics gb; java.awt.Graphics g; java.awt.TextField[] tf; java.awt.Label lbr; java.awt.Label lbg; java.awt.Label lbb; java.awt.Label ltype; String rts; String[] STR; java.awt.Color bgColor; boolean rightClick; boolean dragging; int xs; int ys; int id; java.awt.FontMetrics fm; int chy;
  • 49. fkhStage stage; fkhSprite[] OBJ; java.awt.Image img; int xc; int yc; int dr; int xx; int yy; int size; int size2; java.awt.Color[] clr1; java.awt.Color[] clr2; java.awt.Color[] clr; int mode; int N; int xp; int yp; double r1; double r2; public void init(); public boolean action(java.awt.Event, Object); int cValue(java.awt.TextField); String d2String(double); public boolean mouseDown(java.awt.Event, int, int); void showValue(); public boolean mouseDrag(java.awt.Event, int, int); public boolean mouseUp(java.awt.Event, int, int); public boolean mouseMove(java.awt.Event, int, int); void showRGB(int, int); void setMode(int); void clear(); public void paint(java.awt.Graphics); public void update(java.awt.Graphics); public void rgbLight(); static void <clinit>(); }
  • 50. ripple.classpublicsynchronizedclass ripple extends java.applet.Applet { static boolean free; int yOffset; double time; double ts; java.awt.Dimension area; java.awt.Image bgImage; java.awt.Image fgImage; java.awt.Graphics gb; java.awt.Graphics g; java.awt.Color bgColor; boolean rightClick; boolean dragging; int xs; int ys; java.awt.FontMetrics fm; int chy; fkhStage stage; java.awt.Image img; int xc; int yc; int dr; int xx; int yy; int size; int size2; int xp; int yp; double r1; double r2; public void init(); String d2String(double); public boolean mouseDown(java.awt.Event, int, int);
  • 51. public boolean mouseDrag(java.awt.Event, int, int); public boolean mouseUp(java.awt.Event, int, int); void clear(); public void paint(java.awt.Graphics); public void update(java.awt.Graphics); public void ripple(); static void <clinit>(); } back.gif rgb.gif index.html 標題 起頭 使用說明: 物理解說: 歡迎批評指教! 電子郵件 : 請按 [email protected]作者:國立台灣師範大學物理系黃福坤最後修訂時間: rgbLight.javargbLight.javaimport java.awt.*; import java.awt.image.*; import java.util.*; publicclass rgbLight extends java.applet.Applet{// implements Runnable{ int yOffset=40; Dimension area;
  • 52. Image bgImage,fgImage; Graphics gb,g;//background drawing // Color bgColor=Color.cyan;//white;//cyan;//lightGray; // String tfl[]={"R","G","B"}; TextField tf[]=newTextField[3]; Label lbr,lbg,lbb,ltype; String rts,STR[]={"R","G","B","MSG1","MSG2"}; Color bgColor=newColor(0xC8,0xDF,0xD0); publicvoid init(){ for(int i=0;i<STR.length;i++){ if((rts=getParameter(STR[i]))!=null) STR[i]=newString(rts); } setBackground(bgColor); Panel p=newPanel(); p.add(ltype=newLabel(STR[3]+" ")); p.add(lbr=newLabel(" ")); lbr.setBackground(Color.red); p.add(lbg=newLabel(" ")); lbg.setBackground(Color.green); p.add(lbb=newLabel(" ")); for(int i=0;i<3;i++){ p.add(newLabel(STR[i])); p.add(tf[i]=newTextField(2)); } lbb.setBackground(Color.blue); lbb.setForeground(Color.white); add("North",p); area=size(); clear(); } publicboolean action(Event ev,Object arg){ if(id!=-1&& ev.target instanceofTextField){ try{ Color c=newColor(cValue(tf[0]),cValue(tf[1]),cValue(tf[2])); clr[id]=c;
  • 53. OBJ[id].setColor(c); stage.dirty(); repaint(); }catch(NumberFormatException e){ showValue(); } } returntrue; } int cValue(TextField t){ int value=(int)Integer.parseInt(t.getText())%256; t.setText(String.valueOf(value)); return value; } String d2String(double value){ float f=(float)((int)(value*10.)/10.); String str=String.valueOf(f); if(str.indexOf(".")==-1)str+=".0"; return str; } boolean rightClick=false,dragging=false; int xs,ys,id; publicboolean mouseDown(Event e,int x,int y){ if((y-=yOffset)<0)returnfalse; if(e.modifiers==Event.META_MASK){//"Right Click, "; rightClick=true; if(e.clickCount==2){ if(mode==LIGHT)setMode(PAINT); else setMode(LIGHT); for(int i=0;i<N;i++)OBJ[i].setColor(clr[i]); repaint(); showRGB(x, y); } }else{ rightClick=false; dragging=true;
  • 54. id=stage.which(x,y); showValue(); } xs=x; ys=y; returntrue; } void showValue(){ if(id!=-1)for(int i=0;i<STR.length;i++){ tf[0].setText(String.valueOf(clr[id].getRed())); tf[1].setText(String.valueOf(clr[id].getGreen())); tf[2].setText(String.valueOf(clr[id].getBlue())); } } publicboolean mouseDrag(Event e,int x,int y){ if(!free ||(y-=yOffset)<0)returnfalse; if(dragging){ stage.Drag(id,x-xs,y-ys); xx+=x-xs; yy+=y-ys; repaint(); showRGB(x, y); } xs=x; ys=y; returntrue; } publicboolean mouseUp(Event e,int x,int y){ if((y-=yOffset)<0)returnfalse; dragging=false; returntrue; } publicboolean mouseMove(Event e,int x,int y){ if(dragging ||(y-=yOffset)<0)returnfalse; showRGB(x,y); returntrue;
  • 55. } void showRGB(int x,int y){ int value=stage.getColor(x,y); Color c; if(value==0)c=clr[3]; else c=newColor(value); //clb.setText("("+c.getRed()+","+c.getGreen()+","+c.getBlue()+ ")"); lbr.setText(String.valueOf(c.getRed())); lbg.setText(String.valueOf(c.getGreen())); lbb.setText(String.valueOf(c.getBlue())); } FontMetrics fm; int chy; fkhStage stage; fkhSprite OBJ[]=new fkhSprite[3]; Image img; int xc,yc,dr=6,xx,yy; int size=2,size2=2*size; Color clr1[]={Color.red,Color.green,Color.blue,Color.black}; Color clr2[]={Color.cyan,Color.magenta,Color.yellow,Color.wh ite}; Color clr[]; finalstaticint PAINT=1,LIGHT=0; int mode,N=OBJ.length; void setMode(int newmode){ mode=newmode; if(newmode==LIGHT){ clr=clr1; stage.setMode(fkhStage.OR); ltype.setText(STR[3]); }else{ clr=clr2; stage.setMode(fkhStage.AND); ltype.setText(STR[4]); }
  • 56. gb.setColor(clr[N]); gb.fillRect(0,0, area.width, area.height); // gb.setColor(cs); // gb.drawString(msg,5,chy); } void clear(){ if(g==null){ bgImage = createImage(area.width, area.height); gb = bgImage.getGraphics(); fgImage = createImage(area.width, area.height); g = fgImage.getGraphics(); fm=gb.getFontMetrics(); chy=fm.getHeight(); stage=new fkhStage(area.width,area.height); xc=area.width/2; yc=area.height/2; //mode=LIGHT; setMode(LIGHT); // g.setColor(Color.red); // g.fillOval(25,25,200,100); // g.setColor(Color.yellow); // g.fillOval(50,50,50,50); // OBJ[0]=stage.addImage(5,5,200,100,fgImage,bgColor); OBJ[0]=stage.fillOval(5,5,200,100,clr[0]); OBJ[1]=stage.fillOval(xc,5,200,100,clr[1]); OBJ[2]=stage.fillOval(xc-75,140,150,150,clr[2]); } // repaint(); } publicvoid paint(Graphics gs){ update(gs); } staticboolean free=true; int xp,yp; double r1,r2; publicvoid update(Graphics gs){
  • 57. free=false; g.drawImage(bgImage,0,0,this); if(stage.isDirty()){ stage.flush(); img=createImage(newMemoryImageSource(stage.tmp.w idth, stage.tmp.height, stage.pix,0, stage.tmp.width)); } if(img!=null)g.drawImage(img,stage.tmp.x,stage.tmp.y,this); gs.drawImage(fgImage,0, yOffset,this); free=true; } } ripple.javaripple.javaimport java.awt.*; import java.awt.image.*; import java.util.*; publicclass ripple extends java.applet.Applet{ int yOffset=0; double time=0.0,ts=0.; Dimension area; Image bgImage,fgImage; Graphics gb,g;//background drawing // Color bgColor=Color.cyan;//lightGray; Color bgColor=newColor(0xC8,0xDF,0xD0); publicvoid init(){ setBackground(bgColor); area=size(); clear(); } String d2String(double value){ float f=(float)((int)(value*10.)/10.);
  • 58. String str=String.valueOf(f); if(str.indexOf(".")==-1)str+=".0"; return str; } boolean rightClick=false,dragging=false; int xs,ys; publicboolean mouseDown(Event e,int x,int y){ if((y-=yOffset)<0)returnfalse; if(e.modifiers==Event.META_MASK){//"Right Click, "; rightClick=true; dragging=true; }else{ rightClick=false; repaint(); } xs=x; ys=y; returntrue; } publicboolean mouseDrag(Event e,int x,int y){ if(!free ||(y-=yOffset)<0)returnfalse; if(dragging){ xx+=x-xs; yy+=y-ys; repaint(); } xs=x; ys=y; returntrue; } publicboolean mouseUp(Event e,int x,int y){ if((y-=yOffset)<0)returnfalse; dragging=false; returntrue; }
  • 59. FontMetrics fm; int chy; fkhStage stage; Image img; int xc,yc,dr=6,xx,yy; int size=2,size2=2*size; void clear(){ if(g==null){ bgImage = createImage(area.width, area.height); gb = bgImage.getGraphics(); fgImage = createImage(area.width, area.height); g = fgImage.getGraphics(); fm=gb.getFontMetrics(); chy=fm.getHeight(); stage=new fkhStage(area.width,area.height); xc=area.width/2; yc=area.height/2; xs=xc+12*dr; ys=yc-20*dr; } gb.setColor(bgColor); gb.fillRect(0,0, area.width, area.height); Color clr=Color.darkGray; gb.setColor(clr);//Color.black); for(int i=0,xi=xc-dr,yi=yc-dr,dx=2*dr;xi>0;xi-=dr,yi- =dr,dx+=2*dr) gb.drawOval(xi,yi,dx,dx); gb.setColor(Color.red); gb.fillOval(xc-size,yc-size,size2,size2); stage.drawCircuits(area.width,area.height,xc,xc/dr,clr);//C olor.black);//magenta);//red); xx=6*dr; if(stage.isDirty()){ stage.flush(); img=createImage(newMemoryImageSource(stage.tmp.w idth, stage.tmp.height, stage.pix,0, stage.tmp.width));
  • 60. } } publicvoid paint(Graphics gs){ update(gs); } staticboolean free=true; int xp,yp; double r1,r2; publicvoid update(Graphics gs){ free=false; g.drawImage(bgImage,0,0,this); if(img!=null)g.drawImage(img,xx,yy,this); xp=xx+xc+1; yp=yy+yc; g.setColor(Color.red); g.fillOval(xp-size,yp-size,size2,size2); if(!dragging){ g.setColor(Color.blue);//yellow); // g.drawLine(xp,yp,xc,yc); g.drawLine(xc,yc,xs,ys); g.drawLine(xp,yp,xs,ys); r2=Math.sqrt((xp-xs)*(xp-xs)+(yp-ys)*(yp-ys))/dr; r1=Math.sqrt((xc-xs)*(xc-xs)+(yc-ys)*(yc-ys))/dr; g.drawString("r1 = "+d2String(r1)+", r2 = "+d2String(r 2)+ ", r1-r2 = "+d2String(r1-r2),10,chy); } gs.drawImage(fgImage,0, yOffset,this); free=true; } } fkhStage.javafkhStage.javaimport java.awt.*; import java.awt.image.*;
  • 61. import java.util.*; class fkhStage extends fkhSprite{ intNpts,count; Vector objs=newVector(); boolean changed=false; fkhStage(int w,int h){ super(w,h); } Rectangle tmp; void makeClone(){ tmp=(Rectangle)objs.elementAt(0); for(int i=1;i<count;i++) tmp=tmp.union((Rectangle)objs.elementAt(i)); tmp=intersection(tmp); pix=newint[tmp.width*tmp.height]; } void dirty(){ changed=true; } boolean isDirty(){ return changed; } void clean(){ changed=false; } int id=-1; fkhSprite sprite; publicint which(int xi,int yi){ id=-1; for(int i=0;i<count;i++){ sprite=(fkhSprite)objs.elementAt(i); if(sprite.inside(xi,yi)){ id=i; break; }
  • 62. } return id; } publicvoidDrag(int i,int dx,int dy){ if(id!=-1){ sprite.x+=dx; sprite.y+=dy; dirty(); } } fkhSprite addImage(int xi,int yi,int w,int h,Image img,Color bgColor){ fkhSprite member=new fkhSprite(xi,yi,w,h,img); member.eraseBackground(bgColor);//transparent objs.addElement(member); dirty(); return member; } fkhSprite fillOval(int xi,int yi,int w,int h,Color c){ fkhSprite member=new fkhSprite(xi,yi,w,h,c); member.fillOval(); objs.addElement(member); dirty(); return member; } void drawCircuits(int w,int h,int ri,int N,Color c){ fkhSprite member=new fkhSprite(0,0,w,h); member.Circles(ri/N,c); objs.addElement(member); dirty(); } void flush(){ count=objs.size(); if(changed)makeClone(); elsereturn; // if(objs==null)return;
  • 63. operate((fkhSprite)objs.elementAt(0),COPY); if(count>0)for(int i=1;i<count;i++){ operate((fkhSprite)objs.elementAt(i),mode); } clean(); } int mode=OR;// or and finalstaticint COPY=0,OR=1,AND=2; void setMode(int newmode){ mode=newmode; dirty(); } int getColor(int dx,int dy){ if(tmp!=null&& inside(dx-=tmp.x,dy- =tmp.y))return pix[dy*tmp.width+dx]; elsereturn0; } void operate(fkhSprite src,int mode){ int dd,id,xmin=0,xmax=src.width,ymin=0,ymax=src.height; int id0,xmin0=0,xmax0=tmp.width,ymin0=0,ymax0=tmp.height; int[] pixs=src.pix; if(src.x>tmp.x) xmin0=src.x-tmp.x; else xmin=tmp.x-src.x; if(src.x+src.width>tmp.x+tmp.width)xmax=tmp.x+tmp.width- src.x; else xmax0=src.x+src.width-tmp.x; if(src.y>tmp.y) ymin0=src.y-tmp.y; else ymin=tmp.y-src.y; if(src.y+src.height>tmp.y+tmp.height)ymax=tmp.y+tmp.height- src.y; else ymax0=src.y+src.height-tmp.y; dd=(ymin0-ymin)*tmp.width+xmin0; switch(mode){ case COPY: for(int i=ymin;i<ymax;i++){
  • 64. id0=i*tmp.width+dd; id=i*src.width+xmin; for(int j=xmin;j<xmax;j++){ pix[id0++]= pixs[id++]; // if(pixs[id]!=0)pix[id0++] =pixs[id++] ; } } break; case OR: for(int i=ymin;i<ymax;i++){ id0=i*tmp.width+dd; id=i*src.width+xmin; for(int j=xmin;j<xmax;j++){ pix[id0++]|= pixs[id++]; } } break; case AND: for(int i=ymin;i<ymax;i++){ id0=i*tmp.width+dd; id=i*src.width+xmin; for(int j=xmin;j<xmax;j++,id0++,id++){ if(pix[id0]==0) pix[id0]= pixs[id]; elseif(pixs[id]!=0)pix[id0]&= pixs[id]; } } break; } } } class fkhSprite extendsRectangle{ int[] pix; int index,color=0; fkhSprite(int w,int h){ x=y=0;
  • 65. width=w; height=h; } fkhSprite(int xi,int yi,int w,int h){ init(xi,yi,w,h); } fkhSprite(int xi,int yi,int w,int h,Color c){ init(xi,yi,w,h,c); } /* How to use this Image img=createImage(width,height); // in applets Graphics g=sprite.getGraphic(); g.setColor(Color.yellow); g.fillOval(x,y,w,h);//drawing work s fkhSprite sprite=new fkhSprite(x,y,w,h,img); */ fkhSprite(int xi,int yi,int w,int h,Image img){ init(xi,yi,w,h); PixelGrabber pg =newPixelGrabber(img, x, y, w, h, pix,0, w); try{ pg.grabPixels(); }catch(InterruptedException e){ System.err.println("interrupted waiting for pixels!"); return; } } void init(int xi,int yi,int w,int h){ x=xi; y=yi; width=w; height=h; pix=newint[w*h]; } void init(int xi,int yi,int w,int h,Color c){ init(xi,yi,w,h); index=0;
  • 66. color=c.getRGB(); for(int i=0;i<height;i++) for(int j=0;j<width;j++)pix[index++]=color; } void setColor(Color c){ setColor(c.getRGB()); } void setColor(int value){ int N=width*height; for(int i=0;i<N;i++) if(pix[i]!=0)pix[i]=value; } void transparent(Color bgColor){ int value=bgColor.getRGB(); int N=width*height,code=0xFFFFFF; for(int i=0;i<N;i++) if(pix[i]==value)pix[i]&=code; } void eraseBackground(Color bgColor){ int value=bgColor.getRGB(); int N=width*height; for(int i=0;i<N;i++) if(pix[i]==value)pix[i]=0; } void fillOval(){ double w=width/2.,h=height/2.,w2=w*w,h2=h*h; int wi=(int)w,hi=(int)h,ww=width-1,hh=height-1, dd=hh*width; for(int i=0;i<hi;i++){ for(int j=0;j<wi;j++){ if((i-h)*(i-h)/h2+(j-w)*(j-w)/w2>1.){ index=i*width; pix[index+j]=0; pix[index+ww-j]=0; index=dd-index; pix[index+j]=0;
  • 67. pix[index+ww-j]=0; }elsebreak; } } } finalstaticdouble PI2=Math.PI/2.; voidCircles(int dr,Color clr){ double dc,cmax; int xc=width/2,yc=height/2,r; int xx,yy,color=clr.getRGB(),id0=yc*width+xc,id; intNmax=width*height; for(r=dr;r<xc;r+=dr){ dc=1./r; cmax=PI2*r+dc; for(double c=0.;c<PI2;c+=dc){ xx=(int)(r*Math.cos(c)); yy=(int)(r*Math.sin(c)); //if(xx<xc && yy<yc){ if((id=id0+yy*width+xx)<Nmax){ pix[id]=color; pix[id-=2*xx]=color; if((id-=2*yy*width)>0){ pix[id]=color; pix[id+=2*xx]=color; } } } } } } Prism: Reflection and Refraction
  • 68. Web Site: http://www.phy.ntnu.edu.tw/java/optics/prism_e.html Introduction: This Java applet let you play with a light source and a prism, to study the physics of light. Both reflection and refraction occur at the interface between two media. (Even total internal reflection might also occur.) Light will travel with different speed through different media, which will result in both reflection and refraction. For reflection: the angle of incidence is equal to angle of reflection. For refraction: Snell's law governs the angle index of refraction for media 1 = n1; angle of incidence = 1 index of refraction for media 2 = n2; angle of refraction = 2 Snell’s Law: n1 sin 1 = n2 sin 2 Part of the energy is reflected and the rest propagate into new media. This ratio depends on incident angle and index of refraction (refracted angle). Usage of this Applet: Click the red region to change the light direction. Click another region of light source and you can move the light pen to different locations (even inside the prism). Click one of the corner of the prism to change the shape of
  • 69. prism. Click inside the prism to change its location. When tracing of the light will terminate when the ray intensity is less than 0.4%. The relative intensity for each ray is shown at the boundary. The index of refraction for the prism is initially set at 1.5 Instructions: 1. Load up the Java Lab from the web site shown above. 2. Establish a new prism shape if you want, but keep it generally the shape of what was is displayed at the start of this experiment. 3. Change the index of refraction of the prism (n2) from 1.5 to 1.0 in increments of 0.1. Sketch the light rays for each value of the index of refraction. 4. Reset the prism’s index of refraction (n2) back to 1.5. 5. For three different angles of incidence (either change the shape of the prism, or move the light source around), use a protractor to measure the angle of incidence of the light ray and the corresponding angle of refraction. (Remember that both of these angles are measured from the “normal”, i.e., the line perpendicular to the surface at the point of incidence.) 6. Record your data, and compare your results to Snell’s Law. (Assume that the angle of incidence is measured correctly, and compare the angles of refraction.)
  • 70. 7. List all sources of error (and there should be plenty of them). 8. Finally, write the report with your favorite word processor or text editor and submit is to the instructor. Use the “Sample Laboratory Report” as a guide in preparing your lab report. Any problems – please e-mail me. Also if you have any complaints, comments, suggestions, or kudos concerning this experiment, please e-mail me. It won’t help your class, but I will take them into consideration for the next time this course is offered.