简体   繁体   中英

Expression Simplification using SymPy trigsymp

Why does the following simple example not return 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() .

它似乎只是一个版本问题,在sympy 0.7.6.1中它可以正常工作

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM