[英]Expression Simplification using SymPy trigsymp
Why does the following simple example not return 1? 为什么以下简单示例不返回1?
from sympy import *
r, theta, phi = symbols('r, theta, phi')
pprint(trigsimp(cos(phi)**2 * sin(theta)**2+sin(phi)**2 * sin(theta)**2
+ cos(theta)**2))
Instead, I get 相反,我得到
2 2 2 2 2 2
sin (φ)⋅sin (θ) - cos (φ)⋅cos (θ) + cos (φ) + cos (θ)
the same for simplify()
. 对于simplify()
也是一样。
它似乎只是一个版本问题,在sympy 0.7.6.1中它可以正常工作
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.