File Exchange

image thumbnail

basic paraxial optics toolkit

version (51.5 KB) by Andri M. Gretarsson
A set of paraxial optics functions for beam propagation and modal decomposition. Numerous examples.


Updated 02 Jul 2007

No License

This toolkit has two main purposes.

1. Decomposition and visualization of paraxial beams in Hermite-Gaussian and Laguerre-Gaussian bases. (These functions are located in the subdirectory "transverse.")

2. Propagation of such beams through optical systems including two-mirror fabry-perot cavities. (These functions are located in the subdirectory "axial.")

There is a smattering of other stuff, including the representation of an apodized (clipped) Gaussian beam in terms of its asymptotic expansion (giving Airy patterns.)

All the functions have comments and headers that should enable interested persons to use them. There is also a set of examples demonstrating the basic capabilities.

Cite As

Andri M. Gretarsson (2020). basic paraxial optics toolkit (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (24)


Works great (so far). Using the Project feature of 2019, I analyzed the dependencies of this tool. Seems like something should be documented to include the dependencies. BesselJ is easy to fix. Seems like coatingRT requires the EWA kit ( However, which hermitepoly is supposed to be used in SimpleGaussian_rdep.m ?

Awesome! Just to comment on what Chris Deep said about the AirE.m function. His suggested fix also works for MATLAB 2014! Thank you

Chris Deep

Very good. Just need to remove capitals in the "BesselJ" function and rename "Bessel" function to "bessel" in AiryE.m for compatibility with Matlab 2012.

Chris Deep

Chris Deep

Great job!

zhuziye zhu

Thank you very much!



good work


lu bin

yunshi wang

great work,just need it badly


Great work!
I have problems plotting the LG beam intensity and phase when 'm' the orbital angular momentum goes to values 10-16 !?



seongwoo oh

does anybody know why the simulation doesnt work if you make the cavity length small in the range of a few centimeters?

the code doesnt crash but it doesnt plot anything..


Great Work !!!
Clear wrote code and comments !!!


I found these file very useful. Thanks for doing the hard work and sharing it.

Ricardo Jimenez

There are some bugs in the routines. The demos do not work properly and the documentation is hard to follow.

Liu Changhai

I think it may be useful for me
Thank you very much for your uploading optical programs! I need them.

MATLAB Release Compatibility
Created with R2006a
Compatible with any release
Platform Compatibility
Windows macOS Linux