xy_to_z
- pysmithchart.utils.xy_to_z(*xy)[source]
Converts input arguments to a complex scalar or an array of complex numbers.
- Parameters:
*xy (tuple) –
- If a single argument is passed:
If the argument is a complex number or an array-like of complex numbers, it is returned as-is.
If the argument is an iterable with two rows (e.g., shape (2, N)), it is interpreted as real and imaginary parts, and a complex array is returned.
- If two arguments are passed:
The first argument represents the real part (x), and the second represents the imaginary part (y).
Both arguments must be scalars or iterable objects of the same size. If they are iterable, they are combined to form a complex array.
- Returns:
complex or numpy.ndarray – A complex scalar or array of complex numbers.