Le mardi 27 août 2019 16:51:20 UTC+2, Andreas Hermann a écrit : > > I am sorry, but this is a stupid mistake. The function defined via > set_inverse() is not the inverse function since the first entry of atan2 is > by definition the y-coordinate. If one swaps u and v in atan2 then > everything is fine. >
To avoid such mistake, you can run set_inverse() with the option verbose=True. Then the provided inverse transform is checked. In your original example polar_to_cartesian.set_inverse(sqrt(u*u+v*v), atan2(v,u), verbose=True) leads to Check of the inverse coordinate transformation: r == r th == arctan2(r*cos(th), r*sin(th)) u == v v == u from which we recognize that there is a problem, since the last two lines should be u == u and v == v. Maybe verbose=True should be the default? Best wishes, Eric. -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/a2be97f5-2fd8-4146-bef3-510355f3e376%40googlegroups.com.