Question: Implementing complex numbers. Mathematical preliminaries A complex number is a number that can be expressed in the form a + bi , where a and

Implementing complex numbers. Mathematical preliminaries A complex number is a number that can be expressed in the form a + bi , where a and b are real numbers and i is the imaginary unit, which satises the equation i 2 = 1 . 1 For a + bi we call a the real part and b the imaginary part. We defne addition, subtraction, multiplication, and division as follows: Addition: (a + bi) + (c + di) = (a + c) + (b + d)i Subtraction: (a + bi) (c + di) = (a c) + (b d)i Multiplication: (a + bi)(c + di) = (ac bd) + (bc + ad)i Division: (a + bi) / (c + di) = ((ac + bd) / (c 2 + d 2)) + ((bc ad) / (c 2 + d 2))i

Defne the following Scheme functions that allow you to implement complex numbers: (a) (make-complex a b) , which constructs a complex number with real part a and imaginary part b (b) (real x) , which returns the real part of complex number x , and (c) (imag x) , which returns the imaginary part of complex number x . Hint: use pairs for your information, as in Monday's lecture.

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!