Skip to content

piyushs-05/DiffractionVisualizer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Diffraction Visualizer 🌈🔬

A powerful educational tool designed for the Physics Department to visualize and simulate light diffraction patterns. This Android application helps students understand the wave nature of light through interactive experiments directly on their screens.

📋 Overview

Diffraction Visualizer allows students to experiment with Fraunhofer diffraction patterns in real-time. By adjusting physical parameters, users can observe how light interacts with single, double, and multiple slits, effectively simulating laboratory experiments.

This tool bridges the gap between theoretical equations and visual phenomena, making concepts like interference and diffraction intensity distributions intuitive and engaging.

✨ Key Features

  • Multiple Diffraction Modes:

    • Single Slit: Observe the central maximum and subsidiary maxima.
    • Double Slit (Young's Experiment): Visualize interference fringes superimposed on a diffraction pattern.
    • N-Slit (Diffraction Grating): Explore how increasing the number of slits sharpens the principal maxima.
  • Interactive Parameters:

    • Wavelength (λ): Slider from 400nm to 700nm (Visible Spectrum).
    • Slit Width (b): Adjust the width of the opening.
    • Slit Separation (d): Change the distance between slits (for Double/N-Slit).
    • Distance to Screen (D): Move the observation screen closer or further.
    • Number of Slits (N): Vary the number of slits in N-Slit mode.
  • Real-time Visualization:

    • High-performance rendering of intensity patterns using pixel-perfect calculations.
    • Zoom Support: Pinch-to-zoom gestures to examine fine details of the fringes.
  • Live Calculations:

    • Displays derived values like Angular Separation, Fringe Width, and First Minimum Position.
    • Shows the exact underlying physics equations for the current mode.

📸 Screenshots

Diffraction Visualizer Screenshot 1 Diffraction Visualizer Screenshot 2 Diffraction Visualizer Screenshot 3

🧠 Physics implemented

The application implements the Fraunhofer Diffraction approximations:

1. Single Slit

$$ I = I_0 \left( \frac{\sin \beta}{\beta} \right)^2 $$ Where $\beta = \frac{\pi b x}{\lambda D}$

2. Double Slit

$$ I = I_0 \left( \frac{\sin \beta}{\beta} \right)^2 \cos^2 \gamma $$ Where $\gamma = \frac{\pi d x}{\lambda D}$

3. N-Slit

$$ I = I_0 \left( \frac{\sin \beta}{\beta} \right)^2 \left( \frac{\sin(N\gamma)}{N \sin \gamma} \right)^2 $$

🛠️ Installation & Setup

  1. Clone the repository:

    git clone https://github.com/CyberFranky05/DiffractionVisualizer.git
  2. Open in Android Studio:

    • Launch Android Studio.
    • Select "Open an existing Android Studio project".
    • Navigate to the cloned directory.
  3. Build and Run:

    • Wait for Gradle sync to complete.
    • Connect an Android device or start an Emulator (API 24+ recommended).
    • Click the Run button (or press Shift + F10).

💻 Tech Stack

  • Language: Kotlin
  • UI Framework: Jetpack Compose
  • Architecture: MVVM (Model-View-ViewModel)
  • Concurrency: Kotlin Coroutines for off-main-thread intensity calculations

🤝 Contribution

Feel free to fork the project and encourage students to add new features like:

  • Circular aperture diffraction.
  • 2D Diffraction patterns.
  • Chromatic (white light) simulation.

Created for the Physics Department to enhance student learning. 🎓

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages