Skip to content

Scroll of Complex Numbers

Noxbru edited this page Mar 26, 2012 · 2 revisions

This Scroll is composed of two tomes:

  • Tome of Complex in Binary Form
  • Tome of Complex in Polar Form

Both of them are the same tome but one of them is refered to complex numbers in binary form and the other to complex numbers in polar form. So the functions they have are the same adding "binary" or "polar" where it is needed. From now on, where there's written *** should be understood as "binary" or "polar"

In the Tome of Complex in Binary Form we find that the numbers are a structure with the following form: struct complex_binary { double real; double imaginary; };

In the Tome of Complex in Binary Form we find that the numbers are a structure with the following form: struct complex_binary { double module; double argument; };

So far, both this tomes cointain the following functions:

  • create_complex_***
  • This functions takes two arguments and returns a complex number of the specified form.
  • get_complex_***

/* Functions to create complex numbers in binary form */ struct complex_polar create_complex_polar(double a, double b); struct complex_polar get_complex(void); struct complex_polar copy_complex_polar(struct complex_polar z);

/* Functions to print complex numbers in binary form */ void print_complex(struct complex_polar z);

/* Functions to get info from complex numbers in binary form */ double real_part_polar(struct complex_polar z); double imaginary_part_polar(struct complex_polar z); double module_polar(struct complex_polar z); double argument_polar(struct complex_polar z);

struct complex_polar conjugate_polar(struct complex_polar z); struct complex_polar reciprocal_polar(struct complex_polar z); struct complex_binary polar_to_binary(struct complex_polar z);

/* Functions to do operations with two complex numbers

  • in binary form */ struct complex_polar sum_complex_polar(struct complex_polar z1, struct complex_polar z2); struct complex_polar subtraction_complex_polar(struct complex_polar z1, struct complex_polar z2); struct complex_polar multiplication_complex_polar(struct complex_polar z1, struct complex_polar z2); struct complex_polar division_complex_polar(struct complex_polar z1, struct complex_polar z2);
Clone this wiki locally