我有这个代码:
R = float(input("Enter the arc's radius of curvature: "))
H = float(input("Enter the arc's height: "))
import matplotlib.pyplot as plt
import numpy as np
import math
#cc = center of curvature
cc = math.sqrt(R**2 - (H / 2)**2)
x = np.linspace(-5,5,100)
y = math.sqrt(R**2 - (x - cc)**2)
plt.plot(x, y, 'c')
plt.show()Run Code Online (Sandbox Code Playgroud)
并收到此错误:
类型错误:只有大小为 1 的数组可以转换为 Python 标量
我怎样才能解决这个问题?