Complex math library#
The complex math library implements functions for mathematical operations on complex numbers. The functions are implemented for complex numbers in cartesian form. Transformation functions to and from the polar form are provided. If only one part of the complex number is used (only real, only imaginary or only magnitude), the other part should still be set to zero!!
Reference#
-
typedef struct uz_complex_cartesian_t uz_complex_cartesian_t#
struct for complex number in cartesian form
-
typedef struct uz_complex_polar_t uz_complex_polar_t#
struct for complex number in exponantial form
-
uz_complex_cartesian_t uz_complex_addition(uz_complex_cartesian_t arg1, uz_complex_cartesian_t arg2)#
addition for complex numbers
- Parameters:
arg1 – first summand
arg2 – second summand
- Returns:
uz_complex_cartesian_t the complex addition of both summands
-
uz_complex_cartesian_t uz_complex_subtraction(uz_complex_cartesian_t subtrahend, uz_complex_cartesian_t minuend)#
subtraction for complex numbers
- Parameters:
subtrahend – number to subtract
minuend – number to subtract with
- Returns:
uz_complex_cartesian_t the complex subtraction of subtrahend - minuend
-
uz_complex_cartesian_t uz_complex_multiplication(uz_complex_cartesian_t arg1, uz_complex_cartesian_t arg2)#
multiplication for complex numbers
- Parameters:
arg1 – first factor
arg2 – second factor
- Returns:
uz_complex_cartesian_t the complex multiplication of both factors
-
uz_complex_cartesian_t uz_complex_division(uz_complex_cartesian_t dividend, uz_complex_cartesian_t divisor)#
division for complex numbers
- Parameters:
dividend – number to get divided
divisor – number to divide with
- Returns:
uz_complex_cartesian_t the complex division of dividend/divisor
-
uz_complex_polar_t uz_complex_cartesian_to_polar(uz_complex_cartesian_t in)#
transformation from complex cartesian to complex polar
- Parameters:
in – cartesian complex number
- Returns:
uz_complex_polar_t complex number in polar form
-
uz_complex_cartesian_t uz_complex_polar_to_cartesian(uz_complex_polar_t in)#
transformation from complex polar to complex cartesian
- Parameters:
in – polar complex number
- Returns:
uz_complex_cartesian_t complex number in cartesian form