Comment #6 on issue 2949 by [email protected]: trig functions do not return exact results for half angles
http://code.google.com/p/sympy/issues/detail?id=2949

Well, if you can compute sin(a), then you can compute sin(a/2) using the half angle formula, and visa-versa. This leads to an algorithm to compute angles that are a computable angle divided by a power of 2.

For the rest, I don't know if there is an algorithm other than just computing the minimal polynomial and using the root finding code. Unfortunately, right now, sometimes the root finding code just returns sin's and cos's, so that won't get you anywhere. Actually, I don't know if they can always be expressed in radicals or not. That will require more research.

To find the minimal polynomial, write the trig function in terms of complex exponentials. Then, rewrite the argument of the exponential so that it is in [0, 2*pi). Then, exp(n*pi/m) == RootOf(x**m - 1, n), where n and m are integers and 0 <= n*pi/m < 2*pi.

Actually, I just checked, and the root finding code is not smart enough to find things that the half angle formulas could find. Indeed, it can find RootOf(x**24 - 1, 7), but, for example, RootOf(x**48 - 1, 32) is returned in terms of sin(7*pi/24) and cos(7*pi/24).

So we need to implement the half angle formulas (and others?), and make the root finding code and expand_func(trig_function) do a better job of calling each other.

--
You received this message because you are subscribed to the Google Groups 
"sympy-issues" 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-issues?hl=en.

Reply via email to