def test_R2(): x0, y0, r0, theta0 = symbols('x0, y0, r0, theta0', real=True) point_r = R2_r.point([x0, y0]) point_p = R2_p.point([r0, theta0]) # r**2 = x**2 + y**2 assert (R2.r**2 - R2.x**2 - R2.y**2)(point_r) == 0 assert simplify( (R2.r**2 - R2.x**2 - R2.y**2)(point_p) ) == 0 assert simplify( R2.d_dr(R2.x**2+R2.y**2)(point_p) ) == 2*r0