Test your code by running the following exercises in your main function. Output
ID: 3812716 • Letter: T
Question
Test your code by running the following exercises in your main function. Output your results to standard output. Implement your print function to print the complex number in the x + yi format as shown below in my output 1. create complex point c1 with 4-5i 2. create complex point c2 with 2 + 9i 3. determine phase of c1 and c2 4. add points c1 and c2 5. multiply points c1 and c2 You should get the following output (format your to look like mine). Use the correct cout statements in main() to accomplish this: c1: 4-5i c2: 2 + 9i phase c1: -0.896055 phase c2: 1.35213 c1 + c2: 6 + 4i c1*c2: 53 + 26iExplanation / Answer
using System; using System.Numerics; public class Example { public static void Main() { Complex c1 = Complex.FromPolarCoordinates(10, 45 * Math.PI / 180); Console.WriteLine("{0}:", c1); Console.WriteLine(" Magnitude: {0}", Complex.Abs(c1)); Console.WriteLine(" Phase: {0} radians", c1.Phase); Console.WriteLine(" Phase {0} degrees", c1.Phase * 180/Math.PI); Console.WriteLine(" Atan(b/a): {0}", Math.Atan(c1.Imaginary/c1.Real)); } }
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.