import sympy
from sympy import *
from math import sin,cos
#a=10#a轴长度
#b=10#b轴长度
#x=int(input("x="))
#y=int(input("y="))
A= symbols('A')
B= symbols('B')
AFG=solve([5*cos(A)-5*cos(A+B)-3,5*sin(A)-5*sin(A+B)-4],[A,B])
print(AFG)
运行结果:
runfile('G:/spyder/函数计算.py', wdir='G:/spyder')
Traceback (most recent call last):
File "G:\spyder\函数计算.py", line 21, in
AFG=solve([5cos(A)-5cos(A+B)-3,5sin(A)-5sin(A+B)-4],[A,B])
File "D:\python\lib\site-packages\sympy\core\expr.py", line 358, in float
raise TypeError("can't convert expression to float")
TypeError: can't convert expression to float