Show HN: I was curious about spherical helix, ended up making this visualization (opens in a new tab)visualrambling.space
865 pointsI was wondering how I can arrange objects along a spherical helix path, and read some articles on it.
I ended up learning about parametric equations again, and make this visualization to document what I learned:
https://visualrambling.space/moving-objects-in-3d/
feel free to visit and let me know what you think!

Comments (132) 68 threads
https://en.m.wikipedia.org/wiki/Rhumb_line
Mercator maps made it easier to compute what that bearing ought to be.
https://en.m.wikipedia.org/wiki/Mercator_projection
This configuration is a mathematical gift that keeps giving. Look at it side on in a polar projection you get a logarithmic spiral. Look at it side on you get a wave packet. It's mathematics is so interesting that Erdos had to have a go at it [0]
On a meta note, today seems spherical geometry day on HN.
https://news.ycombinator.com/item?id=44956297
https://news.ycombinator.com/item?id=44939456
https://news.ycombinator.com/item?id=44938622
[0] Spiraling the Earth with C. G. J. Jacobi. Paul Erdös
https://pubs.aip.org/aapt/ajp/article-abstract/68/10/888/105...
https://observablehq.com/@jrus/spheredisksample
https://news.ycombinator.com/item?id=44963521
to fit the trend of the day. People may also enjoy
https://observablehq.com/@jrus/sphere-resample
Edit: fantastic graphics. You should submit the other one as an HN post too.
Do you mean my diagonal grid that I projected back onto the sphere? I'm not sure that has a name.
It is indeed raining spherical geometry today.
It has equal spacing on the surface between lines, a loxodrome can't have that property since by definition it must cross the meridians at the same angle at all times. That means it always gets denser near the poles.
---
Start with the curve:
x = 10 · cos(π·t/2) · sin(0.02·π·t)
y = 10 · sin(π·t/2) · sin(0.02·π·t)
z = 10 · cos(0.02·π·t)
Convert to spherical coordinates (radius R=10):
λ(t) = π/2 · t (longitude)
φ(t) = π/2 - 0.02·π·t (latitude)
Compute derivative d(λ)/d(φ):
d(λ)/dt = π/2
d(φ)/dt = -0.02·π
d(λ)/d(φ) = (π/2)/(-0.02·π) = -25 (constant)
A true rhumb line must satisfy:
d(λ)/d(φ) = tan(α) · sec(φ)
which depends on latitude φ.
Since φ(t) changes, sec(φ) changes, so no fixed α can satisfy this.
Conclusion: the curve is not a rhumb line.
this is how one should look for varying intersection angles:
https://beta.dwitter.net/d/34223
"The simple requirement that one should move on the surface of a sphere with constant speed while maintaining a constant angular velocity with respect to a fixed diameter, leads to a path whose cylindrical coordinates turn out to be given by the Jacobian elliptic functions."
The part that I was expecting to see but didn't: how can you move at a constant speed? For the original purpose of positioning objects along a path, it doesn't matter. But when moving, you can see it's moving much more slowly at the beginning and end (mostly determined by the radius). What if I want it to travel at a constant rate? Or even apply an easing function to the speed?
I'm sure there's some fancy mathematical trick that would just do it. If I were only more comfortable with math... my handwavy sketch would be to compute the speed function by differentiating the formulas to get dx, dy, and dz and passing them through the Pythagorean equation, then reparameterize on a t' variable using the inverse of the speed function? Maybe? I feel like I'm speaking using words I don't understand.
Unfortunately, there’s usually no closed-form solution for it, so we have to do it numerically. And for doing that there’s in general no better way than at each t, binary/interpolation search a dt that roughly corresponds to the ds that you want (start with the previous dt, it’s likely a very good approximation).
In practice, you’d do that once and store the results, basically approximating the curve as a polyline of evenly-spaced points– at least assuming that the curve itself isn’t changing over time!
Generally this idea is called motion profiling: https://www.motioncontroltips.com/what-is-a-motion-profile/
It’s sort of like an Archimedean spiral. So, yeah, if you parameterize velocity and make that constant, you’re in better shape. Note that the radius starts at zero, though, so something is going to have to deal with limits.
A simpler path following approximation (e.g., for a game) might be to just give an iterative system path and tangent targets with respect to Z and then provide an iterative constraint on velocity with some sort of basic tweening (e.g., new = a * old + (1 - a) * target). Then just drag the thing along Z, like bead toys for toddlers.
What you're looking for is called arc length parameterization. Basically, you need to compose the curve with the inverse of its arc length function. Aside from a few special curve families, closed-form solutions don't exist.
currently the path is expressed as function of (t), and it's the t that progressed at the constant speed.
so the cube will finished one loop at the same duration, and thats why it moves much slowly at the beginning and end, where distance of one loop is smaller.
I have to admit I made it that way because it's simpler to implement:D. Making it move at constant speed require some more works, but others have provided some solutions here so I think I'll try
I don't know what function is being presented, so I can't speak to whether it demonstrates chaotic behavior -- but the whole /point/ of chaos is that it's an emergent property of deterministic mathematical functions. Perhaps the author meant "random" or "non-deterministic" rather than "chaotic"?
I am guessing that the HN audience would be / should be interested in that distinction. Mathematically speaking, chaos is an extreme sensitivity to initial conditions, and is very much still in line with deterministic systems. The resulting output, while seemingly random (since there is no easily identifiable pattern), is mathematically and conceptually different from actual randomness.
https://en.wikipedia.org/wiki/Randomness
It really depends on the exact definition of what you are quantifying 'random' to be.
There is no proof (in the mathematical sense) of real randomness.
Continue this thread — 1 reply
In this example the path is neither chaotic (in the formal sense) nor random, because a Fourier transform would identify the harmonic components.
I believe you. But the colloquial definition (I’m looking at a dictionary right now) is “complete disorder and confusion”; “a state of things in which chance is supreme”; “the inherent unpredictability in the behavior of a complex natural system”. That path fits that apparent definition. The post is written in a way that a relative layman would understand, so it makes sense to speak/write in a way non-mathematicians would expect.
Then saying it "isn't actually chaotic" is mis-aligned with the layman's understanding, and the disagreement is not explained (either by explaining a more technical definition, or otherwise).
I continue to think that substituting "non-deterministic" or "random" would be more both understandable to the layman, and more correct to the advanced reader.
Possible topics to branch further into would be polar coordinates and linear algebra basics (vectors, transformations, transformations in 3d space). If you the author aren't sure of such topics, I would recommend 3blue1brown yt videos on the matter
Possibly better for that than for programmers (given it doesn't include code or libraries used or anything about actually manipulating 3d objects like vertices, stretching and morphing to achieve the effect shown etc)
All comments shown.
Couldn't load more comments. Check your connection and try again.