h6ex2: Structure, pointers, and functions

h6ex2: Structure, pointers, and functions

You cannot submit for this problem because the homework's deadline is due.

Description

  1. Write two structures to represent a point in the complex plan. In the README file explain and
    argue on your choices, including data types.

  2. Write two functions to convert from Cartesian to Polar and from Polar to Cartesian. The functions should use pointers such that more than one set of coordinates can be converted at a time. That is the pointer could contain more than one complex number such that the function would returns the conversion of all the complex numbers at once.

  3. In the main function define the following complex numbers and convert them between Cartesian
    and Polar coordinates: \(3+\frac{4}{5}i\), \(\log(4)i\), \(45.245+0.235i\), \(3e^{\frac{i\pi}{17}}\), \(4(\cos\frac{\pi}{9}+i\sin\frac{\pi}{9})\), \(e^{\frac{i\pi}{12}}\)

Format

Files

You should submit a tar file containing a c source file ex2.c

Input

None

Output

Prints the numbers by pair, one pair per line, the original number first and the converted one second, with five decimal points

Sample 1

Output (first line)

3.00000+0.80000i 3.10483e0.26060i

Limitation

1s, 32MiB for each test case.

Assignment 6

Not Claimed
Status
Finished
Problems
6
Open Since
2018-07-01 00:00
DDL
2018-07-10 14:00
Extension
240.0 hour(s)