magnitude_of_vector#

rojak.turbulence.calculations.magnitude_of_vector(x_component: DataArray, y_component: DataArray, is_abs: bool = False, is_squared: bool = False) DataArray[source]#

Magnitude of vector

Convenience method to calculate magnitude of a 2D vector, i.e. \(\sqrt{x^2 + y^2}\)

Parameters:
  • x_component (DataArray) – x-values of vector

  • y_component (DataArray) – y-values of vector

  • is_abs (bool) – If True, the components of vector is absolute (i.e. \(\sqrt{|x|^2 + |y|^2}\). Defaults to False.

  • is_squared (bool) – If True, the components of vector is squared (i.e. \(x^2 + y^2\)). Defaults to False.

Return type:

DataArray