Skip to content

Commit 1487f3f

Browse files
authored
Minor documentation tweaks and test updates (#35)
Also, start testing on nightly again
1 parent e7bb501 commit 1487f3f

File tree

4 files changed

+13
-6
lines changed

4 files changed

+13
-6
lines changed

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
matrix:
1515
version:
1616
- '1'
17-
# - 'nightly'
17+
- 'nightly'
1818
os:
1919
- ubuntu-latest
2020
include:

docs/src/functions_of_time.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ confidence that other `ω⃗` functions would be correctly integrated also.
190190
## Minimal rotation
191191

192192
One common problem arises when a system must be rotated to align some axis with
193-
some direction, though the rotation of the system *about* that axis is
193+
some direction, while the rotation of the system *about* that axis is
194194
irrelevant. To be specific, suppose we want to rotate our basis vectors
195195
``\hat{x}, \hat{y}, \hat{z}`` so that ``\hat{z}`` points in a particular
196196
direction. A naive approach may be to determine the direction in terms of
@@ -201,6 +201,13 @@ orientation will be extremely sensitive to the direction whenever it happens to
201201
be near the poles. In such cases, the angular velocity of the system will be
202202
very high — potentially infinite, in principle.
203203

204+
A *slightly* better approach would be to use ``(\alpha, \beta, \gamma) = (\phi,
205+
\theta, -\phi)``, which is the most direct rotation from the ``z`` axis to the
206+
point given by ``(\theta, \phi)``, and behaves better in the limit of small
207+
``\theta``. However, this only works for rotations directly from the ``z``
208+
axis; the result depends on the choice of coordinates, and is not the best
209+
choice for tracking general motion of the target axis.
210+
204211
Fortunately, it is possible to take *any* rotor ``R_\mathrm{axis}(t)`` that
205212
aligns the axis correctly, and compute another rotation that also aligns the
206213
axis, but has the smallest possible angular velocity. This is called the
@@ -218,8 +225,8 @@ R(t) = R_\mathrm{axis}(t)\, \exp\left[\gamma(t) 𝐤 / 2 \right]
218225
```
219226
This rotor also aligns the axis correctly, but otherwise has the smallest
220227
possible angular velocity. Here, ``R_\mathrm{axis}`` may be constructed in any
221-
convenient way, including using spherical coordinates; the resulting ``R(t)``
222-
will be independent of such poor life choices.
228+
convenient way, including using spherical coordinates or even Euler angles; the
229+
resulting ``R(t)`` will be independent of such poor life choices.
223230

224231

225232
## Derivatives and gradients

test/conversion.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262

6363
@testset "Euler phases" begin
6464
N = 5_000
65-
ϵ = (T === Float16 ? 20eps(T) : 10eps(T))
65+
ϵ = (T === Float16 ? 22eps(T) : 10eps(T))
6666

6767
dumb_to_euler_phases(α, β, γ) = [exp*im), exp*im), exp*im)]
6868

test/math.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
Quaternion(c.re, [comp_i == component ? c.im : zero(real(c)) for comp_i in components]...)
1313
end
1414
@testset "Complex equivalence $T" for T in FloatTypes
15-
ϵ = 10eps(T)
15+
ϵ = (T === Float16 ? 20eps(T) : 10eps(T))
1616
scalars = [zero(T), one(T), -one(T)]
1717
for c in [a+b*im for a in scalars for b in scalars]
1818
# The following constructs a quaternion from the complex number `c` by equating `im`

0 commit comments

Comments
 (0)