The Ronchi program runs from a nested loop.
Each time the inner loop reaches a count that would place a pixel outside the
edge of the mirror the inner loop is set to zero and the outer loop is
incremented. The calculations proceed from the center of the mirror to the
right and down. Reflections of the bottom right quadrant display in the
top left quadrant, the top right quadrant, and the bottom left quadrant.
At each increment, i, j, of the nested loops we must calculate whether we must
set a pixel or not set a pixel.

The first thing to calculate is r, the distance from
the center of the mirror to the point of interest on the mirror for this
calculation. i and j are multiplied by a scalar that depends on the mirror
diameter. We now have x and y which will be set to every point on the
lower right quadrant of the mirror. Using the Pythagorean Theorem, r
squared equals x squared plus y squared, we find r for the pixel of interest on
the mirror. We divide r_squared by the radius_of_curvature of the center of
the mirror. r_sq / R is the difference between the center radius_of_curvature and
the radius_of_curvature(x, y) for the r(x,y) zone. Adding r_sq / R to the
radius_of_curvature gives us a close approximation of the radius_of_curvature(x,
y). We still need to know whether the ray from r(x, y) will pass
through the Ronchi grating or be blocked.

We were given the distance of the grating outside of
the radius of curvature. Radius_of_curvature plus grating_position minus
radius_of_curvature(x, y) equals the distance from the radius_of_curvature(x, y)
to the grating = D. Connecting points r(0) on the mirror with r(x,y) on
the mirror with the point where the ray from r(x,y) crosses the mirror axis
we form a triangle. If you extend the line from r(x, y) through the point
radius_of_curvature(x, y) on the mirror axis to the grating then draw a line to
the mirror axis at the grating then to the radius_of_curvature(x, y) on the
mirror axis a small
triangle is formed. The small triangle is similar to the large triangle we
drew earlier so the distance from the mirror axis to the ray at the grating is
equal to r(x, y) * D / radius_of_curvature(x, y). We were given the
frequency of the grating so we can now find whether or not the ray from r(x, y)
will pass through the grating or not.

Running the program we find the bar that crosses the
center of the mirror is twice too wide. To solve this problem the program
does a preliminary calculation to find the width of the bar at the center of the
mirror. The grating is then shifted the amount needed to make the center
bar 1/2 a bar width wide. So now when the right quadrant is reflected into
the left quadrant the center bar looks one bar width wide.

NOTES

The focal point of the curve at r(x,y) will not actually fall on the mirror axis. It will actually be near the focus of
the mirror center but displaced further from the mirror and also off of the
mirror axis. This inaccuracy in the Ronchi program will hardly make one pixel
difference in the plotting.

The above description of the Ronchi program describes the
DOS version written in Microsoft 'Quick C'. In the Java version the displayed
mirror diameter is always 400 pixels. The calculations are done in centimeters.
Data input is in inches, mm, miles, AU, light years or light waves. Data input is
always converted to centimeters. Output to the screen is multiplied by a
conversion factor ofmirror_diameter in cm to 400 pixels.

In the Java version we found a better method to keep the
center Ronchi bar from being twice too wide. We do a calculation to see if the
pixel is to be set then a second calculation for a grating of twice the
frequency then use an 'exclusive OR' of the two to make the plot. This
eliminates the preliminary calculation used to shift the grating in the DOS
version of the program.