<HTML>
<HEAD>
<title>The Ronchi and Foucault Java Program</title>
</HEAD>
<BODY background="../images/parch.jpg">
<center>
<! +ron+ Key for save settings feature. >
<APPLET codebase="ron_class/" CODE="RonEvent.class" WIDTH=700 HEIGHT=500 >
<!-- milliseconds -->
<PARAM NAME=param_load_display_time VALUE="100" >
<!-- "?1.2345 First character is not a number. -->
<PARAM NAME=mirror_dia VALUE="i12.5" >
<PARAM NAME=Rad_of_crv VALUE="i164" >
<PARAM NAME=grat_Knife_pos VALUE="i-0.22">
<PARAM NAME=grating_freq VALUE="i0.01" >
<!-- 'M' meters, 'm' millimeters, 'w' light waves, -->
<!-- 'i' inches, 'S' miles, 'A' astron units, -->
<! 'L' light years, 'z' default, then set in the source code. -->
<!-- LightS_moves affects the Gr./ K.E. input and the R' minus Ro output. -->
<!-- On your tester does the light source move with the knife edge? -->
<PARAM NAME=LightS_moves VALUE="true" >
<! Wave length of the light. Default 530 nanometers, green light. >
<PARAM NAME=wave_length VALUE="530" >
<!-- "My Mirror" -->
<PARAM NAME=disp_legend Value="My Mirror. "
<!-- function takes r(xy) and R(0) as a parameters. Returns R(xy) minus R(0) to the program. -->
<!-- r(xy) for 100 percent mirror zone is defined as 200 pixels. r(xy)
and R(0) in pixels. -->
<PARAM NAME=function01 Value=" .5 * ( r ^ 2 / R + (r ^4 / 2 * R ^3 ) ) ">
<PARAM NAME=function02 Value=" ( R * ( ( 1 - A * r ^ 2 / R ^ 2 )^1.5 ) - R ) / 3 ">
<PARAM NAME=function03 Value=" ( R * ( ( 1 - B * r ^ 2 / R ^ 2 )^1.5 ) - R ) / 3 ">
<PARAM NAME=constant_A Value="-1"
<!-- Display 1 to 14 digits to right of the . -->
<PARAM NAME=max_display_dig Value="5"
<!-- true OR false, default false. -->
<PARAM NAME=enable_saves VALUE="true" >
<!-- Zone Marker, pin locations. "31.6,54.8,70.7,83.7,94.9" percent zones -->
<PARAM NAME=marker_pins VALUE="31.6,54.8,70.7,83.7,94.9" >
<! First digit 0 to 9, Foucault contrast. Second digit 0 or 1, soft colors. >
<! Normal setting "41" >
<PARAM NAME=cont_color VALUE="41">
< Select a plotting color for color 5. RGB, 0 to 255 >
<! Normal setting "R200G30B30" ('LED Red') >
<!PARAM NAME=my_plot_color VALUE="R200G30B30">
<! Initial plotting color 0 to 5, 0 for white. >
<PARAM NAME=ini_plot_color VALUE="0">
<!-- milliseconds -->
<PARAM NAME=picture_load_time VALUE="1000" >
Applet, Requires Java
</APPLET>
<! -ron- Cancel key for save settings feature. >
<br>
<map name="FPMap0">
<area href="instruct.htm" shape="rect" coords="6, 6, 176, 34">
<area href="instruct.htm#instruction_detail" shape="rect" coords="180, 8, 345, 35">
<area href="../alt_13.htm#Ron_comp" shape="rect" coords="355, 5, 694, 34"></map><img border="0" src="ron_class/ron-btns.gif" usemap="#FPMap0" width="700" height="40">
</center>
<p> </p>
<p> </p>
</BODY>
</HTML>
Explanation of the Ronchi Applet HTML
Code
Note: The code below can be seen in the Microsoft Internet Explorer by
selecting 'View' and then from the menu that drops down select 'Source'.
This is Hyper Text
Markup Language
code. The HTML calls the Java interpreter in your browser to to run the
Java.class file(s). The Java Class files are intended by Sun Microsystems
to be in a universal digital language which can be run in any 'computer operating
system' which has a Sun Java interpreter. The Java Class file(s) were made from
Java Source files using a Java compiler. The Java programmer writes the Java
source files using his or her knowledge of the Java programming language and his
or her Java reference books. A Java source file can then be tested by
the programmer after the source file is compiled into a Java class file. To see a part of a
Java source file go to unit_conv.htm.
<HTML> This tells the browser to
use the HTML protocol to interpret this page. ( Normal web page stuff. )
<HEAD> This tells the browser that
this is the page header which may contain the page title and other
header information such as keywords.
<title>The Ronchi and Foucault Java Program</title>
</HEAD> The header is finished.
<BODY background="../images/parch.jpg">
This
is the body of the applet. Everything here will show on your
web page unless it is a special HTML
symbol.
Show a jpeg image as a page background.
<center> Below this point
center everything on the page until told otherwise.
<! +ron+ Key for save settings feature. > Anything
enclosed in <! something > is a
comment and is ignored
by the HTML interpreter. There is a
version of the Ronchi / Foucault Java applet that can save PARAM s.
+ron+ tells the Ronchi / Foucault
Java applet to look for PARAM beyond this point in the code. This instruction is
ignored by the Java interpreter.
<APPLET codebase="ron_class/" CODE="RonEvent.class" WIDTH=700 HEIGHT=500 >
<APPLET tells the browser "Send this
stuff to the Java virtual machine".
codebase="ron.class/" tells the
Java interpreter which folder to look in for applet .class files (program
files).
RonEvent.class is the file where the
applet's code begins.
WIDTH=700 HEIGHT=500 tells the browser and
the applet how big, in pixels, the applet window will be.
<!-- milliseconds -->
Comment for you to read.
<PARAM NAME=param_load_display_time VALUE="100" >
When the Ronchi program loads it reads
PARAM s from this .html file. There are lots of PARAM s
to load and if we display each one as it
loads for long enough to read it will take a long time for the
program to load. 100 here will
display the PARAM s for .1 seconds each. If you can't read that fast
increase this value. The PARAM s
display in the status bar.
<!-- "?1.2345 First character is not a number. -->
<PARAM NAME=mirror_dia VALUE="i12.5" >
This is where you can enter your mirror's
diameter using Notepad. The i prefix tells the program that
the entry is in inches. Valid characters
for different units of length are given in the comments below. This file is
view_sou.htm. The entries must be made in the file ronchi.html and not in this
file.
<PARAM NAME=Rad_of_crv VALUE="i164" >
Radius of curvature in inches.
<PARAM NAME=grat_Knife_pos VALUE="i-0.22">
Grating or knife edge position in inches.
Number adds to the radius of curvature of the mirror center.
Negative values are nearer the mirror.
<PARAM NAME=grating_freq VALUE="i0.01" >
i0.01 equals 100 lines per inch. ( 1
divided by 100 )
<!-- 'M' meters, 'm' millimeters, 'w' light waves, -->
<!-- 'i' inches, 'S' miles, 'A' astron units, -->
<! 'L' light years, 'z' default, then set in the source code. -->
Valid characters for different units of
length.
<!-- LightS_moves affects the Gr./ K.E. input and the R' minus Ro output. -->
<!-- On your tester does the light source move with the knife edge? -->
<PARAM NAME=LightS_moves VALUE="true" >
If you always use the same tester
edit here and the program will initialize correctly.
Valid entry
"true" or "false"
<! Wave length of the light. Default 530 nanometers, green light. >
<PARAM NAME=wave_length VALUE="530" >
If you are working in the infra red and
want to use an infra red wave length change 530 to whatever.
<!-- "My Mirror" -->
<PARAM NAME=disp_legend Value="My Mirror. "
Put any phrase you like here in place of: My
Mirror. It will
display at the bottom left corner.
<!-- function takes r(xy) and R(0) as a parameters. Returns R(xy) minus R(0) to the program. -->
<!-- r(xy) for 100 percent mirror zone is defined as 200 pixels. r(xy)
and R(0) in pixels. -->
<PARAM NAME=function01 Value=" .5 * ( r ^ 2 / R + (r ^4 / 2 * R ^3 ) ) ">
<PARAM NAME=function02 Value=" ( R * ( ( 1 - A * r ^ 2 / R ^ 2 )^1.5 ) - R ) / 3 ">
<PARAM NAME=function03 Value=" ( R * ( ( 1 - B * r ^ 2 / R ^ 2 )^1.5 ) - R ) / 3 ">
<PARAM NAME=constant_A Value="-1"
These are functions that the Ronchi /
Foucault program will parse.
See ' R'
minus Ro ' on the instructions
page.
<!-- Display 1 to 14 digits to right of the . -->
<PARAM NAME=max_display_dig Value="5"
This PARAM tells the program how many
decimal places to display to the right of the decimal point.
Too low a value will show small fractions as
zero. Values larger than 5 will widen the data entry view windows.
<!-- true OR false, default false. -->
<PARAM NAME=enable_saves VALUE="true" >
In the version of this program that runs in
the 'Applet Viewer' a "false" here will keep the
Ronchi / Foucault program from saving PARAM
s when the 'Save PARAM' button is pressed.
<!-- Zone Marker, pin locations. "31.6,54.8,70.7,83.7,94.9" percent zones -->
<PARAM NAME=marker_pins VALUE="31.6,54.8,70.7,83.7,94.9" >
The values separated by commas above represent
mirror percent zones.
The zones will display when 'Zone Markers'
is selected.
<! First digit 0 to 9, Foucault contrast. Second digit 0 or 1, soft colors. >
<! Normal setting "41" >
<PARAM NAME=cont_color VALUE="41">
Two PARAM s in one. The first digit changes
the contrast for the Foucault display according to
the following logarithmic schedule:
if( cont_temp == '0' ) d_fouc_contr = 0; if( cont_temp
== '1' ) d_fouc_contr = 2;
if( cont_temp == '2' ) d_fouc_contr = 2.52; if(
cont_temp == '3' ) d_fouc_contr = 3.18;
if( cont_temp == '4' ) d_fouc_contr = 4.06; if(
cont_temp == '5' ) d_fouc_contr = 5.08;
if( cont_temp == '6' ) d_fouc_contr = 6.46; if(
cont_temp == '7' ) d_fouc_contr = 8.18;
if( cont_temp == '8' ) d_fouc_contr =10.28; if(
cont_temp == '9' ) d_fouc_contr =12.92;
Set the second digit
to 0, for instance "40", to disable the
'Colors'
button
and make button text black.
< Select a plotting color for color 5. RGB, 0 to 255 >
<! Normal setting "R200G30B30" ('LED Red') >
<!PARAM NAME=my_plot_color VALUE="R200G30B30">
Enter your favorite color here.
Select the color using Paint Brush or other graphics program.
<! Initial plotting color 0 to 5, 0 for white. >
<PARAM NAME=ini_plot_color VALUE="0">
There are six colors, 0 through
5. "5" here will make the program start with the above color.
<!-- milliseconds -->
<PARAM NAME=picture_load_time VALUE="1000" >
This is the length of time the applet will
keep telling the browser to load a picture (background legend).
Set too short and the picture may not load on slow
computers.
Applet, Requires Java This message will
display if the browser has no Java interpreter.
</APPLET>
Cancel applet. Return to
normal HTML protocol.
<! -ron- Cancel key for save settings feature. >
Ron
program, stop looking for "PARAM".
<br>
HTML symbol for typewriter carriage return.
<map name="FPMap0">
<area href="instruct.htm" shape="rect" coords="6, 6, 176, 34">
<area href="instruct.htm#instruction_detail" shape="rect" coords="180, 8, 345, 35">
<area href="../alt_13.htm#Ron_comp" shape="rect" coords="355, 5, 694, 34"></map><img border="0" src="ron_class/ron-btns.gif" usemap="#FPMap0" width="700" height="40">
This section is normal HTML protocol. It
displays buttons with hyperlinks.
It was generated using Microsoft FrontPage.
</center>
Cancel centering.
<p> </p>
Add some extra space
at the bottom of the page.
<p> </p>
</BODY> End of HTML body.
</HTML>
End of HTML protocol.
Take me BACK to the instruction page
Opreators valid for the:
<PARAM NAME=function01 Value="
">
<PARAM NAME=function02 Value="
" >
<PARAM NAME=function03 Value="
" >
Valid operators ( instructions ) for parser. The calculation is done in units of pixel. 200 pixels = normalized mirror radius. |
Example: 10 inch F5 becomes: r(xy) at mirror edge = 200. Ro = 4000 6 inch F8 becomes: |
R | Ro Radius of curvature of mirror. ( at center ) |
r | r(xy) distance from the center of the mirror to a point xy on its surface.
Note: R and r are supplied to the parser by the program in units of pixel. |
A | <PARAM NAME=constant_A Value="10"
Wherever the letter A appears in the formula the A will be replaced by 10 ( in this example ). 'A' must not be of sequence "AB(?)". 'A' must not be of sequence "AN(?)". |
B | Wherever the letter B appears in the formula the B will be replaced by a number you can enter in the 'constant_B' data entry box. When the program initializes constant_B will be set to the value of constant_A. If you decide to set B to another value press the b key on the keyboard to bring up the constant_B data entry box. 'B' must not be of sequence "BS". |
Y | Wherever the letter Y appears in the formula the Y will be replaced by the result of the parse for the pixel just before this pixel unless this pixel is the zero pixel in the row. In which case Y will be zero. |
NEG | NEG
when placed before a constant makes the constant negative. For example NEG 1.414 changes to -1.414 |
PI | PI The constant 3.14159... |
CONE | CONE The constant e, 2.718... |
S | S
Evaluates to: ( r * r ) / 2R Note, the output of the formula parser is doubled if 'light source stationary'. |
RAND | RAND A random number between 0 and 1. |
SIN | SIN Make the sin of the following number. |
COS | COS Make the cos of the following number. |
TAN | TAN Make the tan of the following number. |
IVT | IVT
Make the arc tan of the following number. Sometimes called inverse tangent. |
SQR | SQR Make the square root of the following number. |
ABS | ABS Make the absolute value of the following number. |
LOG | LOG
Make the log to the base e of the following number. Info: LOG10(x) == .4342944819032518*LOG(x) |
EXP | EXP
Raise e to a power. Use the number following EXP. |
^ | ^
Raise the preceding number to a power. Raise the preceding number to the power given in the following number. |
EDG | EDG
Points on the mirror surface outside of the following number evaluate to
r(xy) - number. Points nearer the mirror center evaluate to zero. If number = 0 the mirror edge evaluates to 200. If number = 150 the mirror edge evaluates to 50. |
ZON | ZON
The preceding number specifies the inner edge of the zone. The following number specifies the outer edge of the zone. The zone is +5 pixels un-deep. The zone edges are tapered. number of 200 specifies the mirror edge. |
* | * Multiply the previous number by the following number. |
/ | / Divide the previous number by the following number. |
+ | + Add the previous number to the following number. |
- | - Subtract the following number from the previous number. |
( ) |
( ) Perform all calculations inside parentheses first starting with the inner most paren set. Notes on paren: |
Sample Formula
There are two .html files that will call the ronchi Java Applet.
The files are the same except the PARAM s for the R' - Ro formulas are different.
File:
ronchi.html
This is the default file.
The 'exact' formula for the R squared over R formula given in variations_of_r_sqR.htm
<PARAM NAME=function01 Value=" .5 * ( r ^ 2 / R + (r ^4 / 2 * R ^3 ) ) ">
Formula that determines R(x,y) from the curvature of a conic curve.
Reference 'Astronomical Optics' by Daniel Schroeder, page 32. Also see alt_31.htm.
<PARAM NAME=function02 Value=" ( R * ( ( 1 - A * r ^ 2 / R ^ 2 )^1.5 ) - R ) / 3 ">
<PARAM NAME=constant_A Value="-1"
Formula that determines R(x,y) from the curvature of a conic curve.
Reference 'Astronomical Optics' by Daniel Schroeder, page 32. Also see alt_31.htm.
In this version you can control the value of the conic_constant
while the program is running using the 'constant_B' data entry box. (
b key on the keyboard )
<PARAM NAME=function03 Value=" ( R * ( ( 1 - B * r ^ 2 / R ^ 2 )^1.5 ) - R ) / 3 ">
Sample values for conic_constant, A ( or B for 'constant_B' data entry box. )
Prolate ellipsoid 'A' greater than 0
<PARAM NAME=constant_A Value=".3"
Sphere A = 0
<PARAM NAME=constant_A Value="0"
Oblate ellipsoid A less than 0 and greater than -1
<PARAM NAME=constant_A Value="-.5"
Paraboloid A = -1
<PARAM NAME=constant_A Value="-1"
Hyperboloid A less than -1
<PARAM NAME=constant_A Value="-1.2"
File:
ronchi-alternate.html
This spherical mirror is being tested near its radius of curvature.
The mirror edge from 92 to 100 percent focuses too distant from the mirror
The mirror zone from about 45 to 60 percent focuses too close to the mirror.
<PARAM NAME=function01 Value=" ( 185ZON210 - 90ZON120 ) * .1 ">
This parabolic mirror being tested at its center of curvature has a turned down edge.
<PARAM NAME=function02 Value=" (r ^ 2) / ( 2 * R ) + ((.1 * EDG 186) ^ 3 ) ">
The effect of randomizing the focal length of the pixels.
<PARAM NAME=function03 Value=" RAND" >
Parser Error Codes
Pre Parser Method
R' - R0 = f("+R_R_function_index+"), null PARAM
return;
R' - R0 = f( n ),
too short.
return;
Triggered by:
""
R' - R0 = f( function_index ), PARAM has too many chars.( >64 )
return;
Triggered by:
" 1.2222222222222222222222222222222222222222222222222 / .022222222222222222222222222222222 * RAND"
Buffer function___chars for R' - R0 = f( R_R_function_index ) PARAM is null.
return;
R' - R0 = f( R_R_function_index ), variable's register is null.
return;
R' - R0 = f( R_R_function_index ), Unable to load var register[ n ]
return;
R' - R0 = f( R_R_function_index ), Unable to convert string_temp
to a double.
return;
Triggered by:
" r * r / R + .001.1 "
R' - R0 = f( R_R_function_index ), ')' needed.
return;
Triggered by:
" ( r * r )( / R "
R' - R0 = f( R_R_function_index ), '(' needed.
return;
Triggered by:
" r * r ) / R "
R' - R0 = f( R_R_function_index ), more than 12 paren pairs. ";
return;
Triggered by:
" ()()()()()()()()()()()()( r * r ) / R "
Pre Parser Method non error to status bar:
parser_iterations for f( R_R_function_index ) = n
n is the number of iterations required to parse each pixel using formula:
R_R_function_index
Parser Method
Display recorder:
record_show_calc( index ), too big.
return;
Handled math processor exception:
Divide by zero not allowed. Substituted 1.0 x E-7 (
or: Substituted -1.0 x E-7 )
Triggered by:
" 1 / ( ( r * r / R ) - ( r * r / R ) ) "
Caused by:
<PARAZ NAME=function02 Value=" ( r * r ) / (
R ) " >
In addition to these handled errors and exceptions the Java runtime may generate other unforeseen exceptions which will cause the program to terminate without explanation.
Take me BACK to the instruction page