Open ErjieWu opened 1 year ago
[1] ./light/source/Zernike.cpp
- Thanks for the simplification.
- These two functions are really not used, because the code I got is available so I did not delete them.
- You can change it to c++ 's built-in random number function. Refer to the commented code in ./light/source/ optical_fiele.cpp. [2] ./light/source/Optical_field.cpp
- Since the error of amplitude is not considered in the current study, the initial beam is simplified to a uniform beam.
[1] ./light/source/Zernike.cpp
The following codes seems to realize the function: when input a integer nk, we want to get the total number of species of the Zernike polynomial Z_{n}^{l} with limitation 1≤n≤nk.
However, we can easily know that the number of species of the Zernike polynomial Z_{n}^{l} for a fixed n is n+1, so the result is simply the summation from 2 to nk+1, so the code can be simplified as:
The following code doesn't be used in any other codes, and the function it realizes is weird
(If we want to tick each Zernike polynomials with Noll's sequential indices, the yellow parts should be minus value.
The function mnznk actually realize the function we want, i.e. tick each Zernike polynomials with OSA/ANSI standard indices. By the way, the variable maxZnkDim actually realize the function in issue 1.
The following code doesn't be used in any other codes (judge whether the parities of l and [ni/2] are the same). Maybe useless
A question: Why do we use a homemade random number generation method instead of C++ 's built-in random number algorithm in function rdm_gauss. Here we generate a new random number with uniform distribution in range [0,1) by multiplying the seed (or old random numbers) with the number rq = pi^{8+pi}+pi and taking the decimal part of the result. Does the random number generated by this method conform to the uniform distribution and pass the autocorrelation test?
[2] _./light/source/Opticalfield.cpp