# Introduction to complex numbers

3r3197. 3r3-31. Hello! 3r3184.  3r3197. Finding out that many familiar programmers do not remember complex numbers or remember them very badly, I decided to make a small cheat sheet using formulas. 3r3184.  3r3197. 3r3184.  3r3197. But students can learn something new;) 3r3184.  3r3197. //Anyone interested interested under cat. 3r3184.  3r3197.
3r314. 3r3184.  3r3197. So, this complex numbers are numbers that can be written as
3r3197. 3r3151.
3r3151. 3r3152. 3r3154.
3r3184.  3r3197. Where x, y are real numbers (that is, numbers that are familiar to everyone), and i is a number for which 3r3184.  3r3197. the equality
holds.
3r3151. 3r3152. 3r3334. 3r3154.
3r3184.  3r3197. By the way, -i squared also gives -1. 3r3184.  3r3197. So the statement that if the discriminant is negative, then there is no root is a lie. 3r3184.  3r3197. Or rather, it is performed on a set of real numbers. 3r3184.  3r3197. 3r3184.  3r3197. That is, we can write:
3r3197. 3r3151.
3r3151. 3r3152. 3r3154.
3r3184.  3r3197. x is called the real part, y is the imaginary. 3r3184.  3r3197. This is an algebraic form of writing a complex number. 3r3184.  3r3197. There is also a trigonometric form for recording the complex number z:
3r3197. 3r3151.
3r3151. 3r3152. 3r3154.
3r3184.  3r3197. With the introduction, perhaps, everything. 3r3184.  3r3197. We turn to the most interesting - operations on complex numbers! 3r3184.  3r3197. To begin, consider addition. 3r3184.  3r3197. We have two such complex numbers:
3r3197. 3r3151.
3r3151. 3r3152. 3r3386. 3r3154.
3r3184.  3r3197. How to fold them? 3r3184.  3r3197. Very simple: to fold the real and imaginary parts. 3r3184.  3r3197. We get the number:
3r3197. 3r3151.
3r3151. 3r3152. 3r3154.
3r3184.  3r3197. It's simple, isn't it? 3r3184.  3r3197. Subtraction is the same as adding. 3r3184.  3r3197. You just need to subtract the real part of the number ? 3r3184 from the real part of 1 number.  3r3197. and then do the same with the imaginary part. 3r3184.  3r3197. We get the number
3r3197. 3r3151.
3r3151. 3r3152. 3r3154.
3r3184.  3r3197. Multiplication is done like this:
3r3197. 3r3151.
3r3151. 3r3152. 3r3154.
3r3184.  3r3197. 3r3151.
3r3151. 3r3152. 3r33140. 3r3154.
3r3184.  3r3197. Let me remind you, x is the real part, y is imaginary. 3r3184.  3r3197. The division is done like this:
3r3197. 3r3151.
3r3151. 3r3152. 3r3154.
z3.y = (z1.y * z2.x - z1x * z2.y) /(z2.x * z2.x + z2.y * z2.y) 3r3184.  3r3197. By the way, support for complex numbers is in the standard Python library:
3r3197. 3r3-3160. 3r3161. z1 = 1 + 2j
z2 = 3 + 5j
z3 = z1 + z2
print (z3) # 4 + 6i
3r3r1616. 3r3167. 3r3184.  3r3197. Instead of i, j is used. 3r3184.  3r3197. By the way, this is because Python adopted the convention of electrical engineers who have 3r3184.  3r3197. letter i stands for electric current. 3r3184.  3r3197. Ask your questions, if any, in the comments. 3r3184.  3r3197. I hope you have learned something new. 3r3184.  3r3197. UPD: In the comments asked to talk about the practical application. 3r3184.  3r3197. So complex numbers have found wide practical application in aviation
3r3197. (wing lift) and electricity. 3r3184.  3r3197. As you can see, a very necessary thing;)
3r3197. 3r3197. 3r3197. 3r3190. ! function (e) {function t (t, n) {if (! (n in e)) {for (var r, a = e.document, i = a.scripts, o = i.length; o-- ;) if (-1! == i[o].src.indexOf (t)) {r = i[o]; break} if (! r) {r = a.createElement ("script"), r.type = "text /jаvascript", r.async =! ? r.defer =! ? r.src = t, r.charset = "UTF-8"; var d = function () {var e = a.getElementsByTagName ("script")[0]; e.parentNode.insertBefore (r, e)}; "[object Opera]" == e.opera? a.addEventListener? a.addEventListener ("DOMContentLoaded", d,! 1): e.attachEvent ("onload", d ): d ()}}} t ("//mediator.mail.ru/script/2820404/"""_mediator") () (); 3r3191. 3r3197. 3r3193. 3r3197. 3r3197. 3r3197. 3r3197.
+ 0 -