'Radius of largest circle which fits the curve in Python

How do I find the radius of the largest circle which fits the following curve, y=sin(x)?

import matplotlib.pyplot as plt
import numpy as np
x = np.arange(0,1.01*np.pi,0.01)   # start,stop,step
y = np.sin(x)
plt.plot(x,y)
plt.show()

enter image description here



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source