Question: Complete the complex number class and confirm it by displaying the result: z1z2 + (z1)/(z2-z1) = -14.1834-0760117i for z1= 1.4 +2. 1i and z2 -3.2+4.6i
Complete the complex number class and confirm it by displaying the result:
z1z2 + (z1)/(z2-z1) = -14.1834-0760117i for z1= 1.4 +2. 1i and z2 -3.2+4.6i
using cout and the insertion operator <<.
Create an array of 20 instances of the Complex class all with the same -1.2 imaginary part but with real parts varying between -1.5 and 0.5. Use the index-to-value mapping presented earlier to vary the real part for index values from 0 to 19. For each complex number, compute z2 + z and write its magnitude to a text file with the 20 magnitudes on a single row separated by spaces with a single endl at the end. Take the program created in the previous paragraph, and place it inside a loop iterating 24 times. Have the imaginary part of z depend on this loop with values between -1.2 and 1.2. This requires a 2-dimensional array, or matrix, of complex instances who size is 24x20. Again, write the magnitudes of each z2 + z to a text file where each row in the file corresponds to complex numbers with the same imaginary part. Load the text file into Excel by selecting spaces as delimiters. Select all the data and display as a surface plot, similar to the figure below
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
