code: 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).rcall(point_r) == 0
      assert (
          trigsimp((R2.r**2 - R2.x**2 - R2.y**2).rcall(point_p))
          == 0
      )
      assert (
          trigsimp(R2.e_r(R2.x**2 + R2.y**2).rcall(point_p).doit())
          == 2 * r0
      )
  
      # polar->rect->polar == Id
      a, b = symbols("a b", positive=True)
      m = Matrix([[a], [b]])
  
      # TODO assert m == R2_r.transform(R2_p, R2_p.transform(R2_r, [a, b])).applyfunc(simplify)
      assert m == R2_p.transform(
          R2_r, R2_r.transform(R2_p, m)
      ).applyfunc(simplify)
  
      # deprecated method
      with warns_deprecated_sympy():
          assert m == R2_p.coord_tuple_transform_to(
              R2_r, R2_r.coord_tuple_transform_to(R2_p, m)
          ).applyfunc(simplify)
  
imports: from sympy.core import Lambda, Symbol, symbols
  from sympy.diffgeom.rn import R2, R2_p, R2_r, R3_r, R3_c, R3_s, R2_origin
  from sympy.diffgeom import Manifold, Patch, CoordSystem, Commutator, Differential, TensorProduct, WedgeProduct, BaseCovarDerivativeOp, CovarDerivativeOp, LieDerivative, covariant_order, contravariant_order, twoform_to_matrix, metric_to_Christoffel_1st, metric_to_Christoffel_2nd, metric_to_Riemann_components, metric_to_Ricci_components, intcurve_diffequ, intcurve_series
  from sympy.simplify import trigsimp, simplify
  from sympy.functions import sqrt, atan2, sin
  from sympy.matrices import Matrix
  from sympy.testing.pytest import raises, nocache_fail
  from sympy.testing.pytest import warns_deprecated_sympy
label_desc: Use image node_id 2 for calling a global function with example usage: test_R2() without return types