Code to calculate physics lab data (2019-2020).
This repository contains my code, in Java, which I wrote to calculate data from my physics labs. For convenience, they can all be run from my repl.it.
Here is a quick guide to the Calculate Physics Lab Data repository. If you are looking for a specific file or want to know what each file is for, this should help you. Files are sorted in chronological order.
theSpeedOfSound.java
- Access the Repl: https://repl.it/@kayleyseow/The-Speed-of-Sound#Main.java.
- Inputs: Frequency of the Tuning Fork, Length of the Tube, Diameter of the Tube, and Current Temperature.
- Outputs: Wavelength, Experimental Speed of Sound, Actual Speed of Sound, and Percent Error.
thePendulum.java
- Access the Repl: https://repl.it/@kayleyseow/The-Pendulum#Main.java.
- Inputs: Length and Period of a Simple Pendulum.
- Outputs: The Acceleration Due to Gravity, Absolute Error, and Relative Error.
imageFormationFromSphericalMirrors.java
- Access the Repl: https://repl.it/@kayleyseow/Image-Formation-From-Spherical-Mirrors#Main.java.
- Inputs: Distance of the Object, Distance of the Image, Height of the Image, and Height of the Object.
- Outputs: Theoretical 1 over Focal Length, Height of Image over Height of Object, and Negative Distance of Image over Distance of Object.
LensAndMagnificationEquation.java
- Access the Repl: https://repl.it/@kayleyseow/Lens-and-Magnification-Equation#Main.java.
- Choose between calculating Focal Length, Object Distance, or Image Distance.
- Focal Length:
- Inputs: Object Distance and Image Distance.
- Output: Focal Length.
- Object Distance:
- Inputs: Focal Length and Image Distance.
- Output: Object Distance.
- Image Distance:
- Inputs: Focal Length and Object Distance.
- Output: Image Distance.
- Outputs Degree of Magnification and Type of Magnification for all choices.
TwoSlitInterference.java
- Access the Repl: https://repl.it/@kayleyseow/Two-Slit-Interference#Main.java.
- Inputs: Number of Patterns, Name of Pattern, and Nth Order Maxima, Split Spacing, X, and Length for the Red, Green, and Blue Colors.
- Outputs: Red, Green, and Blue Wavelengths, in mm.
TheDiffractionGrating.java
- Access the Repl: https://repl.it/@kayleyseow/The-Diffraction-Grating#Main.java.
- Inputs: X1 and X2 for Violet, Blue, Green, Yellow, Orange, and Red Colors.
- Outputs: Wavelength 1 and 2 in cm and mm for Violet, Blue, Green, Yellow, Orange, and Red Colors, and Total Percent Error.
ConvergingLensImageAndObjectRelationships.java
- Access the Repl: https://repl.it/@kayleyseow/Converging-Lens-Image-And-Object-Relationships#Main.java.
- Inputs: Distance of the Object, Distance of the Image, Height of the Image, and Height of the Object.
- Outputs: Theoretical 1 over Focal Length, Height of Image over Height of Object, and Negative Distance of Image over Distance of Object.