title: How do I work with vectors in cylindrical and spherical systems with SymPy?
body: <p>With SymPy, I can perform basic mathematical operations with vectors in cartesian system. For example:</p>
  <pre><code>from sympy.vector import CoordSys3D
  
  N = CoordSys3D('N')
  
  v1 = 3*N.i - 2*N.j - 4*N.k # Vector 1
  v2 = 2*N.i - 4*N.j + 2*N.k # Vector 2
  
  print(v1 + v2) # Sum
  print(v1 - v2) # Difference
  print(v1 &amp; v2) # Dot product
  print(v1 ^ v2) # Cross product
  print(v1.magnitude()) # Magnitude
  print(v1.normalize()) # Normalize
  </code></pre>
  <p>But when I try to do the same in another coordinate system. For example, lets calculate the magnitude of a vector in cylindrical system:</p>
  <pre><code>from sympy import pi
  from sympy.vector import CoordSys3D
  
  N = CoordSys3D('N', transformation='cylindrical', variable_names=(&quot;rho&quot;, &quot;phi&quot;, &quot;z&quot;))
  
  v1 = 4*N.i + (pi/2)*N.j + 3*N.k
  
  print(v1.magnitude())
  </code></pre>
  <p>The output is <code>sqrt(pi**2/4 + 25)</code> but the spected is <code>5</code>.</p>
  <p>What is the correct way to perform all these operations with vectors in different coordinate systems?</p>