microsoft/qdk

Public

mirrored fromhttps://github.com/microsoft/qdkAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
iadavis/arm-runners

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

katas/content/complex_arithmetic/complex_multiplication/solution.md

5lines · modepreview

Multiplying complex numbers is just like multiplying polynomials. Distribute one of the complex numbers, then multiply through (keep in mind that $i^2 =-1$), and group the real and imaginary terms together:

$x \cdot y = (a + bi)(c + di) = a \cdot c + a \cdot di + c \cdot bi + bi \cdot di = \underset{real}{\underbrace{a \cdot c - b \cdot d}} + \underset{imaginary}{\underbrace{(a \cdot d + c \cdot b)}}i $

@[solution]({"id": "complex_arithmetic__complex_multiplication_solution", "codePath": "Solution.qs"})