2020
09-27
09-27
python 已知平行四边形三个点,求第四个点的案例
我就废话不多说了,大家还是直接看代码吧!importnumpyasnp#已知平行四边形三个点,求第四个点#计算两点之间的距离defCalcEuclideanDistance(point1,point2):vec1=np.array(point1)vec2=np.array(point2)distance=np.linalg.norm(vec1-vec2)returndistance#计算第四个点defCalcFourthPoint(point1,point2,point3):#pint3为A点D=(point1[0]+point2[0]-point3[0],point1[1]+point2[1]-point3[1])return...
继续阅读 >