code: def transform_vectors_sph_to_cart(
      theta, phi, r, u, v, w
  ):  # numpydoc ignore=RT02
      """Transform vectors from spherical (r, phi, theta) to cartesian coordinates (z, y, x).
  
      Note the "reverse" order of arrays's axes, commonly used in geosciences.
  
      Parameters
      ----------
      theta : array_like[float]
          Azimuthal angle in degrees ``[0, 360]`` of shape ``(M,)``.
      phi : array_like[float]
          Polar (zenith) angle in degrees ``[0, 180]`` of shape ``(N,)``.
      r : array_like[float]
          Distance (radius) from the point of origin of shape ``(P,)``.
      u : array_like[float]
          X-component of the vector of shape ``(P, N, M)``.
      v : array_like[float]
          Y-component of the vector of shape ``(P, N, M)``.
      w : array_like[float]
          Z-component of the vector of shape ``(P, N, M)``.
  
      Returns
      -------
      u_t, v_t, w_t : :class:`numpy.ndarray`
          Arrays of transformed x-, y-, z-components, respectively.
  
      """
      xx, yy, _ = np.meshgrid(
          np.radians(theta), np.radians(phi), r, indexing="ij"
      )
      th, ph = xx.squeeze(), yy.squeeze()
  
      # Transform wind components from spherical to cartesian coordinates
      # https://en.wikipedia.org/wiki/Vector_fields_in_cylindrical_and_spherical_coordinates
      u_t = (
          np.sin(ph) * np.cos(th) * w
          + np.cos(ph) * np.cos(th) * v
          - np.sin(th) * u
      )
      v_t = (
          np.sin(ph) * np.sin(th) * w
          + np.cos(ph) * np.sin(th) * v
          + np.cos(th) * u
      )
      w_t = np.cos(ph) * w - np.sin(ph) * v
  
      return u_t, v_t, w_t
  
file_path: pyvista/pyvista/core/utilities/features.py
imports: import collections.abc
  import os
  import sys
  from typing import Sequence
  import numpy
  import pyvista
  from pyvista.core import _vtk_core
  from .helpers import wrap
label_desc: Use image node_id 5 for calling a global function with example usage: transform_vectors_sph_to_cart(theta, phi, r, u, v, w) and returns: u_t,  v_t,  w_t