Question: C# - task 3 A complex number C consists of two parts, one real and one imaginary. It can be written as follows: C =

C# - task 3

A complex number C consists of two parts, one real and one imaginary. It can be written as follows:

C = Cr + j Cj, where Cr and Cj are real numbers and j is the imaginary number ?-1

Here the Cr is the real part and j Cj the imaginary part of the complex number C.

A multiplication between two complex numbers follows common rules for multiplication of two two-element factors (remember that j2 = -1):

A B = (Ar + jAj) (Br + jBj) = (Ar Br - Aj Bj) + j (Ar Bj + Aj Br) = Cr + jCj = C

Define a method that can multiply two complex numbers according to the formula above. Use the void as the function's return data type, the components of the complex numbers A and B as "input" parameters, and the components of the result, the complex number C, as "out" parameters (ie, reference transfer values).

Test the function with a program that presents the calculation and results, as these examples show:

(1 + 2j) * (3 -4j) = 11 + 2j

(20 -10j) * (-2 -4j) = -80-60j

For reasons sake: The order of the factors is indifferent, so that A B = B A.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!