Dear list.

I stumbled upon a case where one invocation of trigsimp() doesn't
completely simplify an expression, but calling trigsimp() a second
time on the result leads to further simplification.

Is this normal?

I know that for simplify() there are arguments like "ratio" and
"measure" for specifying how far the simplification should go. But
those don't seem to exist for trigsimp()?

Here's an example where this is happening:
https://audioscenedescriptionformat.readthedocs.io/en/latest/quaternions.html#Quaternion-to-Rotation-Matrix

Here's a Binder link to try it out:
https://mybinder.org/v2/gh/AudioSceneDescriptionFormat/asdf/master?filepath=doc/quaternions.ipynb

For example, the expression

    -2*(-sin(alpha/2)*sin(gamma/2)*cos(beta/2) +
sin(beta/2)*cos(alpha/2)*cos(gamma/2))**2 -
2*(sin(alpha/2)*cos(beta/2)*cos(gamma/2) +
sin(beta/2)*sin(gamma/2)*cos(alpha/2))**2 + 1

... is in the first run of `trigsimp()` simplified to:

    cos(alpha - beta)/2 + cos(alpha + beta)/2

... which can be simplified by a second run of `trigsimp()` to:

    cos(alpha)*cos(beta)

Am I supposed to just call trigsimp() twice or is there a better way?

cheers,
Matthias

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/CAFesC-dEHXvxdVW%3D8KAARucmeKG28U63YorZrBLyWijYfwUG0Q%40mail.gmail.com.

Reply via email to