Skip to content

Commit af0352e

Browse files
committed
Some additional organization for Complex docc.
1 parent 2361b49 commit af0352e

File tree

2 files changed

+43
-6
lines changed

2 files changed

+43
-6
lines changed

Sources/ComplexModule/Documentation.docc/Complex.md

Lines changed: 41 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
# ``Complex``
22

3-
## Real and imaginary parts
3+
A Complex number type that conforms to ``AlgebraicField`` (so all the normal
4+
arithmetic operations are available) and ``ElementaryFunctions`` (so all
5+
the usual math functions are available).
46

57
A `Complex` value is represented with two `RealType` values, corresponding to
6-
the real and imaginary parts of the number:
8+
the real and imaginary parts of the number.
9+
10+
You can access these Cartesian components using the real and imaginary
11+
properties.
712

813
```swift
914
let z = Complex(1,-1) // 1 - i
@@ -24,9 +29,41 @@ let im = w.imag // .nan
2429

2530
See <doc:Infinity> for more details.
2631

27-
### Length and magnitude
28-
2932
The ``magnitude`` property of a complex number is the infinity norm of the
3033
value (a.k.a. “maximum norm” or “Чебышёв norm”). To get the two norm (a.k.a
3134
"Euclidean norm"), use the ``length`` property. See <doc:Magnitude> for more
3235
details.
36+
37+
## Topics
38+
39+
### Real and imaginary parts
40+
41+
- ``real``
42+
- ``imaginary``
43+
- ``rawStorage``
44+
- ``init(_:_:)``
45+
- ``init(_:)-(RealType)``
46+
- ``init(imaginary:)``
47+
48+
### Phase, length and magnitude
49+
50+
- ``magnitude``
51+
- ``length``
52+
- ``lengthSquared``
53+
- ``normalized``
54+
- ``phase``
55+
- ``polar``
56+
- ``init(length:phase:)``
57+
58+
### Scaling by real numbers
59+
- ``multiplied(by:)``
60+
- ``divided(by:)``
61+
62+
### Complex-specific operations
63+
- ``conjugate``
64+
65+
### Classification
66+
- ``isZero``
67+
- ``isSubnormal``
68+
- ``isNormal``
69+
- ``isFinite``

Sources/ComplexModule/Documentation.docc/Magnitude.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ that the maximum norm lacks:
8383
‖zw‖₂ = ‖z‖₂‖w‖₂ for any two complex numbers z and w.
8484

8585
> Exercises:
86-
> 1. Why isn't the maximum norm multiplicative?
87-
(Hint: Let `z = Complex(1,1)`, and consider `z*z`.)
86+
> 1. Find z and w that show that the maximum norm is not multiplicative.
87+
(i.e. exhibit z and w such that ‖zw‖ ≠ ‖z‖‖w‖.)
8888
> 2. Is the 1-norm multiplicative?
8989
9090
### Implementation notes:

0 commit comments

Comments
 (0)