Skip to content

Latest commit

 

History

History

0x00-math_complex

0x00-math_complex

Build the structure “complex” where a complex number a + ib is represented by two doubles.

Write a function that displays the complex numbers, followed by a new line.

  • Prototype: void display_complex_number(complex c);
  • You can use printf in your code

Write a function that returns the conjugate of a given complex number.

  • Prototype: complex conjugate(complex c);

Write a function that returns the modulus of a given complex number.

  • Prototype: double modulus(complex c);
  • You can use the library <math.h> in your code

Write a function that returns the argument of a given complex number.

  • Prototype: double argument(complex c);
  • You can use the library <math.h> in your code

Write a function that performs the addition operation to complex numbers.

  • Prototype: void addition(complex c1, complex c2, complex *c3);

Write a function that performs the substraction operation to complex numbers.

  • Prototype: void substraction(complex c1, complex c2, complex *c3);

Write a function that performs the multiplication operation to complex numbers.

  • Prototype: void multiplication(complex c1, complex c2, complex *c3);

Write a function that performs the division operation to complex numbers.

  • Prototype: void division(complex c1, complex c2, complex *c3);

Write a function that update the real and the imaginary parts of a complex number given its modulus and arguments.

  • Prototype: void complex_from_mod_arg (double m, double arg, complex *c3);
  • You can use the library <math.h> in your code