Skip to content

Commit

Permalink
Updating description complex-numbers
Browse files Browse the repository at this point in the history
  • Loading branch information
jagdish-15 committed Nov 19, 2024
1 parent 2c9e279 commit ddf83b9
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions exercises/complex-numbers/description.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,47 +37,54 @@ The square of the absolute value is computed as the product of `z` and its conju
The sum of two complex numbers `z1 = a + b * i` and `z2 = c + d * i` is computed by adding their real and imaginary parts separately:

```text
z1 + z2 = (a + b * i) + (c + d * i) = (a + c) + (b + d) * i
z1 + z2 = (a + b * i) + (c + d * i)
= (a + c) + (b + d) * i
```

### Subtraction

The difference of two complex numbers is obtained by subtracting their respective parts:

```text
z1 - z2 = (a + b * i) - (c + d * i) = (a - c) + (b - d) * i
z1 - z2 = (a + b * i) - (c + d * i)
= (a - c) + (b - d) * i
```

### Multiplication

The product of two complex numbers is defined as:

```text
z1 * z2 = (a + b * i) * (c + d * i) = (a * c - b * d) + (b * c + a * d) * i
z1 * z2 = (a + b * i) * (c + d * i)
= (a * c - b * d) + (b * c + a * d) * i
```

### Reciprocal

The reciprocal of a non-zero complex number is given by:

```text
1 / z = 1 / (a + b * i) = a / (a^2 + b^2) - b / (a^2 + b^2) * i
1 / z = 1 / (a + b * i)
= a / (a^2 + b^2) - b / (a^2 + b^2) * i
```

### Division

The division of one complex number by another is given by:

```text
z1 / z2 = z1 * (1 / z2) = (a + b * i) / (c + d * i) = (a * c + b * d) / (c^2 + d^2) + (b * c - a * d) / (c^2 + d^2) * i
z1 / z2 = z1 * (1 / z2)
= (a + b * i) / (c + d * i)
= (a * c + b * d) / (c^2 + d^2) + (b * c - a * d) / (c^2 + d^2) * i
```

### Exponentiation

Raising _e_ (the base of the natural logarithm) to a complex exponent can be expressed using Euler's formula:

```text
e^(a + b * i) = e^a * e^(b * i) = e^a * (cos(b) + i * sin(b))
e^(a + b * i) = e^a * e^(b * i)
= e^a * (cos(b) + i * sin(b))
```

## Implementation Requirements
Expand Down

0 comments on commit ddf83b9

Please sign in to comment.