Giter Site home page Giter Site logo

hellpig / phasor-addition-from-slits Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 96 KB

functions to study the interference of light waves that emerge in phase from equal-width evenly-spaced slits assuming a screen is far away relative to slit spacing

License: MIT License

Python 100.00%
diffraction diffraction-pattern electromagnetic-wave-interference huygens-fresnel-principle intensity interference-pattern kirchhoffs-diffraction-formula light-interference multiple-slits phasor-addition

phasor-addition-from-slits's Introduction

phasor-addition-from-slits

phasor.py contains 3 main functions. Each function studies the interference of light waves that emerge in phase from equal-width evenly-spaced slits assuming a screen is far away relative to slit spacing. The intended audience is students and instructors of introductory university (calc-based) physics.

  • phasors(N) animates, graphs, and provides an interactive mode for N > 1 slits
  • phasorsSingle(a) animates and graphs single-slit patterns
  • phasorsFull(N, d, a) animates and graphs N slits of width a, where d > a is the distance between the centers of adjacent slits

All distance units are the light's wavelength.

phasors(4) interactive mode:
                        sample image 2

phasorsFull(10, 4, 1) graphs:
                        sample image 1

See the top of phasor.py for how to import the functions into Python 3! The matplotlib module is required. I thought it would be interesting to not import the numpy module, so I don't import it!

To complete an animation, close the figure window. Or, you may set animate = False in phasor.py.

According to Kirchhoff's diffraction formula, intensity of far-screen (Fraunhofer) diffraction through a single slit acquires an obliquity factor of (1+cos(theta))^2/4 that the Huygens-Fresnel principle cannot derive. In any animation that takes into account slit width, the length of each arrow changes due to this factor. Even with this factor, all results are approximate due to approximations made in deriving Kirchhoff's diffraction formula. Results are especially approximate when a << 1.

You are meant to play around with the code in phasor.py, so look at phasor.py to find more thorough documentation!

phasor-addition-from-slits's People

Contributors

hellpig avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.