Ask Your Question

Revision history [back]

Well, when Trac ticket #24623 will have been reviewed and merged in SageMath (maybe in version 8.2?), you will be able to do

sage: E.<x,y> = EuclideanSpace(2)
sage: cartesian = E.cartesian_coordinates()
sage: polar.<r,t> = E.polar_coordinates()
sage: R, T = E.coord_change(cartesian, polar)(x,y)
sage: R, T
(sqrt(x^2 + y^2), arctan2(y, x))
sage: b = var('b')
sage: eq0 = r==1/(1+b*cos(t))
sage: eq1 = eq0.subs({r: R, t: T})
sage: eq2 = (R/eq1).expand() - 1; eq2
0 == b*x + sqrt(x^2 + y^2) - 1

Meanwhile, you can define by hand R=sqrt(x^2+y^2) and T=arctan2(y,x) and perform the above substitutions.