> ipdb> print ex > arctan2(real_part(y) + imag_part(x), real_part(x) - imag_part(y)) > > Both of these fail because Sage doesn't define a symbolic arctan2 > function. There is instead a simple wrapper around arctan in > sage/functions/trig.py: > > sage: arctan2(x,y) > arctan(x/y) > > It's possible that this worked on 4.0, and I broke it with #6244. > > I opened a ticket: > > http://trac.sagemath.org/sage_trac/ticket/6421 > > I don't think I will have time to fix this in the next few days. Feel > free to replicate one of the Function_* classes in > sage/functions/trig.py to define a new symbolic function called > arctan2, with ginac conversion atan2. >
Just FYI, in 4.0.1 neither of the original plots work (something about calling float()...). Anyway: sage: arctan2(1,-1) -1/4*pi sage: atan2(1,-1) -1/4*pi sage: maxima.atan2(1,-1) 3*%pi/4 sage: math.atan2(1,-1) 2.3561944901923448 sage: SR(1).arctan2(-1) 3/4*pi Question: Sage's current arctan2/atan2 seems to be the only such thing that does NOT go from -pi to pi (because it is arctan(y/x), quadrant is ignored). Is this a problem, either for fixing #6421 or for other reasons? My inclination would be to have Sage's arctan2 simply call math.atan2 or something else, but at any rate to be consistent. - kcrisman --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-devel@googlegroups.com To unsubscribe from this group, send email to sage-devel-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---