from math import cos, sin,pix0,y0=0,0r=4.0angle=-25x1 = x0 + r * cos(angle * pi / 180)y1 = y0 + r * sin(angle * pi /180)print(x1)print(y1)
根据点的坐标画出圆的内接三角形:
import numpy as npimport matplotlib.pyplot as pltx = y = np.arange(-5, 5, 0.1)x1=[-3.064177772475912,0,3.6252311481465997,-3.064177772475912]y1=[-2.571150438746157,4,-1.6904730469627978,-2.571150438746157]x, y = np.meshgrid(x,y)plt.contour(x, y, x**2 + y**2, [16]) #x**2 + y**2 = 9 的圆形plt.plot(0,0,'r.')plt.plot(x1,y1,'r-')plt.axis('scaled')plt.show()