You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Interpolate between `a` and `b`, at a proportion `i01`
23
+
Interpolate between `a` and `b`, at a proportion `i01`
24
24
between 0 and 1 along the path from `a` to `b`.
25
25
26
+
Uses the tangent-vector form `cos(r)·a + sin(r)·dir` — where `r = i01 ·
27
+
spherical_distance(a, b)` and `dir = normalize(robust_cross_product(a, b) × a)`
28
+
is the unit tangent at `a` pointing toward `b`. This avoids the `1/sin(Ω)`
29
+
divisor of the classic `sin((1-t)Ω)/sin(Ω) · a + sin(tΩ)/sin(Ω) · b`
30
+
formulation, which collapses for near- and exactly-antipodal inputs.
31
+
Adapted from Google's S2 geometry library (see [`S2::Interpolate`](https://github.com/google/s2geometry/blob/a4f0cf58a9cfc214585c39de6e3682384fac0917/src/s2/s2edge_distances.cc#L77)
32
+
and [`S2::GetPointOnLine`](https://github.com/google/s2geometry/blob/a4f0cf58a9cfc214585c39de6e3682384fac0917/src/s2/s2edge_distances.cc#L47)).
33
+
34
+
For exactly antipodal `a` and `b` the great circle is mathematically
35
+
ambiguous; `robust_cross_product` returns a deterministic perpendicular via
36
+
its symbolic-perturbation branch, so the result is still a well-defined unit
37
+
vector on *some* great circle through both points.
0 commit comments