Code below is for viewing, actual code is in file surf.html up

<HTML>

<HEAD>

<title>Mirror Surface Profile Plot, Java Program</title>

</HEAD>

<BODY background="../images/parch.jpg">

<center>

<! +ron+ Key for save settings feature. > 
<APPLET codebase="surf_class/" CODE="SurfEvent.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="i10" > 

<PARAM NAME=Rad_of_crv VALUE="i100" > 

<!-- tube_CL_to_focus must be negative otherwise -->
<!-- value is seconary obstruction diameter . --> 
<PARAM NAME=tube_CL_to_focus VALUE="i2"> 

<!-- Readings from the knife edge micrometer for zones: -->
<!-- marker_pins value="31.6,54.8,70.7,83.7,94.9", for example. --> 
<PARAM NAME=data_1 VALUE="i.01189" > 

<PARAM NAME=data_2 VALUE="i.03576" > 

<PARAM NAME=data_3 VALUE="i.05953" > 

<PARAM NAME=data_4 VALUE="i.08343" > 

<PARAM NAME=data_5 VALUE="i.10726" > 

<PARAM NAME=data_6 VALUE="i.0" > 

<PARAM NAME=data_7 VALUE="i.0" > 

<PARAM NAME=data_8 VALUE="i.0" > 
<!-- 'M' meters, 'm' millimeters, 'w' light waves, -->
<!-- 'i' inches, 'S' miles, 'A' astron units, -->
<! 'L' light years, 'z' default, may be set in the source code. -->

<!-- Default display scale for the graphing of knife edge measurements. -->
<PARAM NAME=starward_scale VALUE="i.5" > 
<!-- Default display scale for the graphing of the mirror surface. -->
<PARAM NAME=surface_scale VALUE="w5" > 

<!-- 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=" r ^ 2 / R + (r ^4 / 2 * R ^3 )">

<PARAM NAME=function02 Value=" (2/3 )*( R * (( 1 - B * r ^ 2 / R ^ 2 )^1.5 ) - R )"> 

<PARAM NAME=function03 Value=" ((-2 * R)-SQR(((R*2)^2) - 4*r*r * ( 1 + B )))/2 * (1+B)">

<PARAM NAME=constant_A Value="-.5 "

<!-- If it is necessary to parse the above formulas to provide program parameters. -->
<!-- true OR false, false = prompt user, true = recalculate without prompt. -->
<!-- Upper case to skip wedge and legend intro's -->
<PARAM NAME=auto_recalc VALUE="true" -->

<!-- Display 1 to 14 digits to right of the . -->
<PARAM NAME=max_display_dig Value="5" 

<!-- 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" > 

<!-- Sets data_(n) all to the same units if param name=data_(n) missing. -->
<PARAM NAME=zone_units VALUE="m" > 
<!-- '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. -->

<!-- circ_weight_ini affects the fourth and fifth buttons on the left side of the plot board. -->
<!-- "off" = fourth button display same as third button. Fifth button weighted for phase only. -->
<!-- "norm" = fourth and fifth button times 3/2r is normalized for comparing with "off". -->
<!-- Note, "off" and "norm" give the same area under the error plot line if the error plot line -->
<!-- is linear. For example, the linear error plot line of the 'wedge display'. -->
<!-- With 'wedge display' on, "off" and "norm" give 400 under the curve. No secondary dia. -->
<!-- "circ" = fourth and fifth button times pi * 2r is circumference weighting -->
<PARAM NAME=circ_weight_ini VALUE="norm" -->

<! 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="5">

<!-- milliseconds --> 
<PARAM NAME=picture_load_time VALUE="500" > 

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#Surf_return" shape="rect" coords="355, 5, 694, 34"></map><img border="0" src="surf_class/surf-btns.gif" usemap="#FPMap0" width="700" height="40">

</center>


<p>&nbsp;</p>
<p>&nbsp;</p>


</BODY> 
</HTML>

Explanation of the Surf 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="surf_class/" CODE="SurfEvent.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 Surf 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="i10" > 
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 surf.html and not in this file.
 
<PARAM NAME=Rad_of_crv VALUE="i100" > 
Radius of curvature in inches.
 

<!-- tube_CL_to_focus must be negative otherwise -->
<!-- value is seconary obstruction diameter . --> 
<PARAM NAME=tube_CL_to_focus VALUE="i2">  
This PARAM is used for two different values that affect the center area of the mirror that is shaded by the telescope diagonal.  Positive entries are the diameter of the shaded area.  If the entry is negative the value is used differently by the program. If the value is negative it is the value L needed for calculation of diagonal size which of course affects the diameter of the shaded area. See: Diagonal Size
 

<!-- Readings from the knife edge micrometer for zones: -->
<!-- marker_pins value="31.6,54.8,70.7,83.7,94.9", for example. --> 
<PARAM NAME=data_1 VALUE="i.01189" > 

<PARAM NAME=data_2 VALUE="i.03576" > 

<PARAM NAME=data_3 VALUE="i.05953" > 

<PARAM NAME=data_4 VALUE="i.08343" > 

<PARAM NAME=data_5 VALUE="i.10726" > 

<PARAM NAME=data_6 VALUE="i.0" > 

<PARAM NAME=data_7 VALUE="i.0" > 

<PARAM NAME=data_8 VALUE="i.0" > 
These are the data from your knife edge measurements.  There is also a 'zero pin'  which can be set from the program and cannot be set from this group of PARAM's.  It is not necessary to use all these pins if nine pins are not needed.  See  marker_pins PARAM below. 

<!-- 'M' meters, 'm' millimeters, 'w' light waves, -->
<!-- 'i' inches, 'S' miles, 'A' astron units, -->
<! 'L' light years, 'z' default, may be set in the source code. --> 
These are the units of length that the program can handle.
One of the characters: M, m, w, i, S, A, or L is placed before a datum to tell the program the units of length. 


<!-- Default display scale for the graphing of knife edge measurements. -->
<PARAM NAME=starward_scale VALUE="i.5" > 
<!-- Default display scale for the graphing of the mirror surface. -->
<PARAM NAME=surface_scale VALUE="w5" > 
The initial display scale for the plot board. Scale can be changed while the program is running.
Starward scale is bottom left and Surface scale is bottom right only when the plot board is visible.


<!-- 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" > 
For the program to produce the correct display LightS_moves must be set correctly.
The first comment line is from the Ronchi/Foucault program which preceded this program.


<! 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 of the image showing the mirror silhouette. ( Its behind the plot board display )


<!-- 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=" r ^ 2 / R + (r ^4 / 2 * R ^3 )">

<PARAM NAME=function02 Value=" (2/3 )*( R * (( 1 - B * r ^ 2 / R ^ 2 )^1.5 ) - R )"> 

<PARAM NAME=function03 Value=" ((-2 * R)-SQR(((R*2)^2) - 4*r*r * ( 1 + B )))/2 * (1+B)">

<PARAM NAME=constant_A Value="-.5 "These are functions that the Surf program will parse.
See ' R' minus Ro ' on the instructions page.


<!-- If it is necessary to parse the above formulas to provide program parameters. -->
<!-- true OR false, false = prompt user, true = recalculate without prompt. -->
<!-- Upper case to skip wedge and legend intro's -->
<PARAM NAME=auto_recalc VALUE="true" -->
If set to false the program will prompt you every time it tries to use the formu_starward_metric[] and finds the array null. If set to true the program will press the 'start plot' button for you if it finds the array null.
auto_recalc set to false will allow use of the starward to surface transform without the use of its transform correction array.


<!-- 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.

<!-- 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" > 
This is where you set the percent zones for your zone marker pins.
The unused pins will be set to a percent zone of less than zero.  The program interprets pins at negative percent zones as 'Deactivated'. 

<!-- Sets data_(n) all to the same units if param name=data_(n) missing. -->
<PARAM NAME=zone_units VALUE="m" > 
<!-- '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. --> 
If the prefix for a pin datum is missing then use the units as declared by: PARAM =zone_units.

<!-- circ_weight_ini affects the fourth and fifth buttons on the left side of the plot board. -->
<!-- "off" = fourth button display same as third button. Fifth button weighted for phase only. -->
<!-- "norm" = fourth and fifth button times 3/2r is normalized for comparing with "off". -->
<!-- Note, "off" and "norm" give the same area under the error plot line if the error plot line -->
<!-- is linear. For example, the linear error plot line of the 'wedge display'. -->
<!-- With 'wedge display' on, "off" and "norm" give 400 under the curve. No secondary dia. -->
<!-- "circ" = fourth and fifth button times pi * 2r is circumference weighting -->
<PARAM NAME=circ_weight_ini VALUE="norm" -->
This PARAM initializes the circumference weighting of the mirror surface display.
Circumference weighting is either off,  weighted  2r * pi  or  weighted  3/2r.
To change while the program is in operation use the 'o' or 'O' key on the keyboard.


<! 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 is not used in the Surf program. ( Used in the Ronchi/Foucault program. )
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="5">
 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="500" > 
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>&nbsp;</p> Add some extra space at the bottom of the page.
<p>&nbsp;</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(xy) at mirror edge = 200.
Ro = 6400
   See Note A

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 starward output of the formula parser
                     is doubled if 'light source stationary'.
                     The surface output of the parser to 
                    
'formula as a surface reference' is not changed
                      by light source moves, true or false. 
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:
( 4 * 4 ) + 5 evaluates to 21.
( 4 * 4)  * 5 evaluates to 80.
( 4 * 4) 5     evaluates to 16. (error)
After the numbers inside a paren have been evaluated the numbers become a single number with no paren.

Below are some custom operator for the Surf Program.
These operators can be used to test the RMS display by use of random numbers to generate a rough surface or to simulate atmospheric turbulence.  See the Note B for more explanation.
RANQ RANQ is the result of processing random numbers to reduce the high frequency components and simulate 'dog biscuit'.
M M in the formula is the corresponding array element in a reference array.  The array formula_as_a_reference_starward_metric[] is the reference.  formula_as_a_reference_starward_metric[] is loaded with the formula parser output by a right click on 'Transform of Starward Formula' button on the plot board.
The metric values are converted to pixels.
W  W,   The reference calculation:
 formula_as_a_reference_starward_metric[] is the reference. 
The metric values are converted to pixels.
 Accumulates the area under the reference curve and the area under the present curve so far as this plot has progressed.
 Subtracts the area under the reference curve from the
 area under this curve.
 
'W' is used as a 'servo' to remove the low frequency component from the results of a formula containing random numbers.

Note A:
The radius of the mirror is 200 pixels using a custom formula.  The reason for this is that the formula parser derived from the
Ronchi/Foucault program which used 200 pixels for mirror radius.
And to re standardize on 400 pixels would have required re doing the Ronchi Java source code.

 

 

Sample Formula

Below are two .html files that can call the Surf Java Applet.
The files are the same except the PARAM s for the R' - Ro formulas are different.

File:
surf_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=" 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="( 2 / 3 )*( R * ( ( 1 - A * r ^ 2 / R ^ 2 )^1.5 ) - R )"> 
<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.


<PARAM NAME=function03 Value="( 2 / 3 )*( R * ( ( 1 - B * r ^ 2 / R ^ 2 )^1.5 ) - R )"> 


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: surf_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) / 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.(>60) 
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

 

Notes on the special parser operators: RANQ,  and W.

RANQ, Java Source Code, from class: RmR_fuct.Java  ( Class RmR_fuct source file. )

for( i = ev_from; i <= ev_to; i++ )
{
if( funct_char__copy.charAt( i ) == '$' ) /* random ( average ) */ 
{
double average = 0;
boolean less_than_zero = false;
average_6 = average_5;
average_5 = average_4;
average_4 = average_3;
average_3 = average_2;
average_2 = average_1;
average_1 = Math.random() - .5;
if( average_1 + average_2 + average_3 + average_4 + average_5 + average_6 < 0 )
less_than_zero = true;
average = average_1 * average_1;
average += average_2 * average_2;
average += average_3 * average_3;
average += average_4 * average_4;
average += average_5 * average_5;
average += average_6 * average_6;
average = average / 6;
average = Math.sqrt( average ); 
if( less_than_zero )
d_function_varib[ i ] = -average;
else 
d_function_varib[ i ] = average; 
funct_char__copy.setCharAt( i, 'N' ); 
evalu_made = true;

}
if( evalu_made )
break; 

Translation:

Over a range of array elements starting at  ev_from  and ending at   ev_to  look for a character ('$') in an array called function_of_characters[].  $ is a stand in for RANQ in this case.

If you find $:

Declare a double precision variable:  average   and a boolean:  less_than_zero

Shift random numbers through a shift register of double precisions.

if( average_1 + average_2 + average_3 + average_4 + average_5 + average_6 < 0 )
less_than_zero = true;

If the average of the numbers is less than zero then set boolean: less_than_zero  to  true.

Find the RMS value of the numbers in the shift register.

If  boolean  less_than_zero  is true then change the sign of the RMS value to negative.

d_function_varib[ i ] = average; 

Return the value by assigning it to array element  i of the double precision array  d_function_varib[].

i in the array d_function_varib[] is the corresponding array element as i in funct_char__copy[] where the $ was found.

If a $ was found and handled return to the calling method without proceeding further,

else continue to look for other operators in funct_char__copy[] array....

 

W, Java Source Code, from class: RmR_fuct.Java  ( Class RmR_fuct source file. )

if( param_W_active )
{
W_accumulation__this += previous_returned_value;
double temp = 0;
if( pixel_count >= 0 && pixel_count < 401 )
{
temp = formula_as_a_reference_starward_metric[ pixel_count ]; 
W_accumulation_refer += 400 * ( temp / metric_cm[ m_d_btn ] );

double d_height = W_accumulation__this - W_accumulation_refer;
int curve = (int)Math.rint( d_height );
g_plot_board.setColor( Color.blue ); 
int x_pos = pixel_count + plot_bo_mirror_center;
if( curve > -plot_board_clip && curve < plot_board_clip )
{
curve = mirror_surface_ref_line - curve;
g_plot_board.drawLine( x_pos, curve, x_pos, curve );
}
else
{
g_plot_board.setColor( Color.black );
if( curve > plot_board_clip )
g_plot_board.drawLine( x_pos, mirror_surface_ref_line - plot_board_clip + 1, 
x_pos, mirror_surface_ref_line - plot_board_clip + 1 );
else
g_plot_board.drawLine( x_pos, mirror_surface_ref_line + plot_board_clip - 1,
x_pos, mirror_surface_ref_line + plot_board_clip - 1 );

} // end param_W_active

 

The above code segment is inside a loop that is incrementing from the mirror center to the mirror edge.

Translation:

If there was a 'W' in the formula:
Add the previous returned value ('Y') to a double precision number that is acting as an accumulator.

Declare double precision number named:   temp   and set it to zero.

pixel_count is the mirror radius for this pixel.  If pixel count is within the array bounds of
formula_as_a_reference_starward_metric[] then retrieve the double precision metric cm value from
formula_as_a_reference_starward_metric[]
And convert that metric value to pixels and add it to the reference accumulator: W_accumulation_refer 

Subtract the reference accumulator from the accumulator and put the result into d_height :
double d_height = W_accumulation__this - W_accumulation_refer;

The remainder of the code segment plots the curve on the plot board in blue color as the parse progresses.

And elsewhere in the code W_accumulation__this - W_accumulation_refer is assigned to d_function_varib[ i ]