Skip to content

Commit a5cd7e0

Browse files
authored
Merge branch 'exercism:main' into fft
2 parents e413f8f + f03352b commit a5cd7e0

File tree

3 files changed

+27
-3
lines changed

3 files changed

+27
-3
lines changed

concepts/complex-numbers/about.md

+13-1
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,11 @@ So a simple expression with three of the most important constants in nature `e`,
193193
Some people believe this is the most beautiful result in all of mathematics.
194194
It dates back to around 1740.
195195

196-
The polar `(r, θ)` notation is so useful, that there are built-in functions `cis` (short for cos(x) + isin(x)) and `cispi` (short for cos(πx) + isin(πx)) which can help in constructing it more efficiently.
196+
The polar `(r, θ)` notation is so useful, that there are built-in functions `cis` (short for `cos(x) + isin(x)`) and `cispi` (short for `cos(πx) + isin(πx)`) which can help in constructing it more efficiently.
197+
198+
The usefulness of polar notation is found in Euler's elegant formula, `ℯ^(iθ) = cos(θ) + isin(θ) = x + iy`, where `|x + iy| = 1`.
199+
With `|x + iy| = r`, we have the more general polar form of `r * ℯ^(iθ) = r * (cos(θ) + isin(θ)) = x + iy`.
200+
Note that the exponential form, in particular, is compact and easy to manipulate.
197201

198202
```julia-repl
199203
julia> exp(1im * π) ≈ cis(π) ≈ cispi(1)
@@ -220,6 +224,14 @@ julia> cispi(θ / π) # θ/π == 1/2
220224
0.0 + 1.0im
221225
```
222226

227+
Incidentally, this makes complex numbers very useful for performing rotations and radial displacements in 2D.
228+
229+
For rotations, the complex number `z = x + iy`, can be rotated an angle `θ` about the origin with a simple multiplication: `z * ℯ^(iθ)`.
230+
Note that the `x` and `y` here are just the usual coordinates on the real 2D Cartesian plane, and a positive angle results in a *counterclockwise* rotation, while a negative angle results in a *clockwise* one.
231+
232+
Likewise simply, a radial displacement `Δr` can be made by adding it to the magnitude `r` of a complex number in the polar form (eg. `z = r * ℯ^(iθ)` -> `z' = (r + Δr) * ℯ^(iθ)`).
233+
Note how the angular part stays the same and only the magnitude, `r`, is varied, as expected.
234+
223235
-----
224236

225237
## Optional section: a Complex Numbers FAQ

concepts/complex-numbers/introduction.md

+13-1
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,11 @@ julia> round(imag(euler), digits=15) # round to 15 decimal places
159159
0.0
160160
```
161161

162-
The polar `(r, θ)` notation is so useful, that there are built-in functions `cis` (short for cos(x) + isin(x)) and `cispi` (short for cos(πx) + isin(πx)) which can help in constructing it more efficiently.
162+
The polar `(r, θ)` notation is so useful, that there are built-in functions `cis` (short for `cos(x) + isin(x)`) and `cispi` (short for `cos(πx) + isin(πx)`) which can help in constructing it more efficiently.
163+
164+
The usefulness of polar notation is found in Euler's elegant formula, `ℯ^(iθ) = cos(θ) + isin(θ) = x + iy`, where `|x + iy| = 1`.
165+
With `|x + iy| = r`, we have the more general polar form of `r * ℯ^(iθ) = r * (cos(θ) + isin(θ)) = x + iy`.
166+
Note that the exponential form, in particular, is compact and easy to manipulate.
163167

164168
```julia-repl
165169
julia> exp(1im * π) ≈ cis(π) ≈ cispi(1)
@@ -185,3 +189,11 @@ julia> cis(θ)
185189
julia> cispi(θ / π) # θ/π == 1/2
186190
0.0 + 1.0im
187191
```
192+
193+
Incidentally, this makes complex numbers very useful for performing rotations and radial displacements in 2D.
194+
195+
For rotations, the complex number `z = x + iy`, can be rotated an angle `θ` about the origin with a simple multiplication: `z * ℯ^(iθ)`.
196+
Note that the `x` and `y` here are just the usual coordinates on the real 2D Cartesian plane, and a positive angle results in a *counterclockwise* rotation, while a negative angle results in a *clockwise* one.
197+
198+
Likewise simply, a radial displacement `Δr` can be made by adding it to the magnitude `r` of a complex number in the polar form (eg. `z = r * ℯ^(iθ)` -> `z' = (r + Δr) * ℯ^(iθ)`).
199+
Note how the angular part stays the same and only the magnitude, `r`, is varied, as expected.

config.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@
227227
"function-composition",
228228
"functions"
229229
],
230-
"status": "wip"
230+
"status": "beta"
231231
},
232232
{
233233
"slug": "old-annalyns-infiltration",

0 commit comments

Comments
 (0)