Java-based Hologram Formula Calculator

Adam Fields

Description

This project consists of a Java-based hologram formula calculator, using the grating equation (sine-theta equation) and the 1/R equation. The following list of variables can be selected for recalculation based on the rest of the variables. Adjusting any value in the display, except the ones being recalculated, will cause the beams to change based on the new settings. Changes in the dependent variable in the equation will be ignored and readjusted when the "recalculate" button is clicked. The left hand (blue) window shows the construction phase of building a hologram. Here, you can position the object beam and the reference beam, as well as change the reference beam's wavelength. The right hand (red) window shows the playback phase. Here, you can position the illumnation beam and the virtual image beam, as well as change the illumnation beam's wavelength. The two equations used to calculate the values are:



The display will automatically update when a recalculation is performed by pressing the "recalculate" button. Enhancements since the demo include the removal of the restriction on theta for all beams - any beam can now exist at any angle - and the addition of beam labels on the display, identifying each beam and giving its x and y coordinates in screen space. For angles, the x axis is 0, negative is above the x axis, and positive is below the x axis. For R's, positive is in the initial quadrant of the angle, negative in the diagonally opposite. Clicking on the "reset" button will reset the values to their defaults.

Notes

Design Decisions

Comments

I'm very happy with the way this project turned out. As a newcomer to OOP, Event-driven UI's, and Java itself, I'm pleased with the results. If I were to start again, I probably would have designed it differently, given what I now know about Java. However, it works. Enhancements that I will eventually get to are futher error checking, drag 'n' drop of the beams themselves, a more customizable UI, and more dimensions. If nothing else, it's certainly made it easier to visualize the effects of changing the variables in a holo-system.

The Program

* Click here for 640 x 480 displays.
* Click here for 800 x 600 displays.
* Click here for 1024 x 768 displays.
* Click here for source code.


Back
Send mail to Adam