import numpy as np
import matplotlib.pyplot as plt
if __name__ == '__main__':
x1, y1 = 0, 30
x3, y3 = 200, -10
x2, y2 = 100, 200
sample_size = 500
theta = np.arange(0,1,0.001)
x = theta * x1 + (1 - theta) * x2
y = theta * y1 + (1 - theta) * y2
plt.plot(x,y,'g--',linewidth=2)
x = theta * x1 + (1 - theta) * x3
y = theta * y1 + (1 - theta) * y3
plt.plot(x, y, 'g--', linewidth=2)
x = theta * x2 + (1 - theta) * x3
y = theta * y2 + (1 - theta) * y3
plt.plot(x, y, 'g--', linewidth=2)
rnd1 = np.random.random(size = sample_size)
rnd2 = np.random.random(size=sample_size)
rnd2 = np.sqrt(rnd2)
x = rnd2 * (rnd1 * x1 + (1 - rnd1) * x2) + (1 - rnd2) * x3
y = rnd2 * (rnd1 * y1 + (1 - rnd1) * y2) + (1 - rnd2) * y3
plt.plot(x,y,'ro')
plt.grid(True)
# plt.savefig('demo.png')
plt.show()
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有