Updated 29 Oct 2008
FRESNEL(X) calculates the values of the Fresnel integrals for real values of vector X,
C = \int_0^x cos(pi*t^2/2) dt, (0a)
S = \int_0^x sin(pi*t^2/2) dt (0b)
Also, it evaluates the following variations of the Fresnel integrals
C1 = \sqrt(2/pi) \int_0^x cos(t^2) dt, (1a)
S1 = \sqrt(2/pi) \int_0^x sin(t^2) dt (1b)
C2 = \sqrt(1/2/pi) \int_0^x cos(t) / \sqrt(t) dt, (2a)
S2 = \sqrt(1/2/pi) \int_0^x sin(t) / \sqrt(t) dt (2b)
The integrals are calculated as follows:
- Values of X in the interval [-5,5] are looked up in Table 7.7 in  and interpolated ('cubic'), if necessary. This table has values of the Fresnel integrals with 7 significant digits and even linear interpolation gives an error of no more than 3e-004.
- Values outside the interval [-5,5] are evaluated using the approximations under Table 7.7 in . The error is less than
NOTE: The Tables were OCR'ed and although thoroughly checked, there might be some mistakes. Please let me know if you find any.
 Abramowitz, M. and Stegun, I. A. (Eds.). "Error Function and Fresnel Integrals." Ch. 7 in "Handbook of mathematical functions with formulas, Graphs, and mathematical tables", 9th printing. New York: Dover, pp. 295-329, 1970.
EXAMPLES OF USAGE
>> Y = fresnel(X,'c');
returns the Fresnel C integral according to eq. (0a)
>> Y = fresnel(X,'s',2);
returns the Fresnel S integral values according to eq. (2b)
>> [C,S] = fresnel(X,,1)
returns the both the Fresnel C and S integral values according to eqs. (1a), (1b)
>> [C,S] = fresnel(X,)
returns the both the Fresnel C and S integral values according to eqs. (0a), (0b)
Christos Saragiotis (2023). Fresnel integrals (https://www.mathworks.com/matlabcentral/fileexchange/20052-fresnel-integrals), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform CompatibilityWindows macOS Linux
Inspired: FresnelS and FresnelC
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!
Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
Corrected the OCR typos mentioned by Peter Volegov (thanks, Peter, for taking the time) and three or four others as well. I checked it with some other relevant functions and it seems to be working OK now (differences are of the order of 1e-8).