gpt4 book ai didi

python计算三角形定点坐标

转载 作者:知者 更新时间:2024-03-12 19:58:35 24 4
gpt4 key购买 nike

import  numpy as np
import matplotlib.pyplot as plt

def getXy(angle=60):

    # print(np.sin(angle/180*np.pi))

    a=0.866

    aa=np.arcsin(a)
    # aaa= round(aa*180/np.pi,2)
    #
    # print (aaa)

    a=1
    b=1

    c=5
    d=5

    distance=np.sqrt(np.square(d-b)+np.square(c-a))/2

    m=(a+c)/2
    n=(b+d)/2

    jijiao=np.arctan((d-b)/(c-a))

    y=n+ distance*np.sin(2*angle/180*np.pi+jijiao)
    x=m+distance*np.cos(2*angle/180*np.pi+jijiao)
    print("x:",x,y)
    # print(jijiao*180/np.pi)
    # print("he:",( np.square(x-a)+np.square(y-b)+np.square(x-c)+np.square(y-d)))
    # print("he2",np.square(c-a)+np.square(d-b))
    # xx=[a,c,x]
# yy=[b,d,y]
# plt.plot(xx,yy)
# plt.show()

getXy(60)
getXy(300)

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com