Create a Fresnel Function in Python

thumbnail

In this tutorial you will learn to create Fresnel function in Python. We need to import scipy and matplotlib. The source code to import is detailed below.

from scipy.special import fresnel
import matplotlib.pyplot as plt
import numpy as np
t = np.linspace(-10,10,1000)
FS, FC = fresnel(t)
fig1 = plt.figure(figsize=(10,5))
#Cornu Spiral
ax1 = plt.subplot(1,2,1)
ax1.plot(FC,FS)
ax1.set_xlabel('C(t)')
ax1.set_ylabel('S(t)')
ax1.set_title('Cornu Spiral', weight='bold')
#Frestel Integral
ax2 = plt.subplot(1,2,2)
ax2.plot(t,FS,ls='-')
ax2.plot(t,FS,ls='--')
ax2.set_xlabel('S(t)')
ax2.set_title('Fresnel Integral', weight='bold')

The output will be:

Back To Top