Hi all,
I have an expression like:
e = a + b + c*sin(x) + d*cos(x+y) + e*sin(z)**2*cos(2*z)
and I want to produce a list where just the calls to sin and cos are
collected:
desired_result = [sin(x), cos(x+y), sin(z), cos(2*z)]
Alternatively, the arguments would be sufficient:
desired_result2 = [x, x+y, z, 2*z]
I tried it with pattern matching but without success.
I think there is an elegant and short way to do it but I do not see it
right now...
Thanks.
Bastian
--
You received this message because you are subscribed to the Google Groups
"sympy" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sympy?hl=en.