Show HN: I was curious about spherical helix, ended up making this visualization
484 damarberlari 95 8/20/2025, 2:02:47 PM visualrambling.space ↗
I 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!
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.
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/
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.
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.
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 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.
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.
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)
The equation used creates a visually appealing result but I’m wondering what a good goal would be in terms of consistency in the distance between the spirals, or evenness in area divided, or something like that.
How was this particular function selected? Was it derived in some way or simply hand-selected to look pleasing?
The actual "correct" thing to do would probably be to have the point maintain constant speed in 3D space like a real boat sailing on a globe, right? But that's a rather bigger lift:
with outputs, I doubt that they did the ln(tan(phi/2)) thing though, but it's what you get when you integrate the k d{phi} = sin{phi} d{theta} equation that you have here.Actually, now that I think about it, choosing z = c * t is kind of both influencing how the path is parameterized as well as the path carved out on the sphere.
also, the progress dots at the bottom should be toc nav buttons, single stepping backward to find the slide above was torture.
and the derivation of a circle from two sines and a sphere from three, to me should really be separated out as a "pre req" presentation. this thought goes along with the above "hey, where's my helix" thought
I very recently was looking to generate some complex shapes, and stumbled onto the complex problem of "disperse N points on sphere" and all its nuances.
There was a really cool / simple algorithm that was mentioned called the fibonacci-sphere that also generates a spiral around a sphere, but for the point dispersal. Here's a paper [1] on it that talks more about it.
[1] - https://arxiv.org/pdf/0912.4540
Interesting to note that the parametric equations of the spiral are linear in spherical coordinates. https://en.wikipedia.org/wiki/List_of_common_coordinate_tran...
* I wrote a similar article around making "blobs" a while back: https://www.hailpixel.com/articles/generative-art-simple-mat...
If you want really great further consideration of creating geometric figures with parametric equations, Joseph Choma's book "Morphing" is an all-timer.
https://www.quercusbooks.co.uk/titles/joseph-choma/morphing/...
I do like this and will share with a couple of friends. But I no longer have a Twitter account and will definitely not rejoin. Would you consider adding an RSS or JSON feed to your website? Or make a Mastodon account, those provide RSS feeds by default.
Twitter is the absolute worst way to get that, even if I had an account.
Does anyone know of any tooling I could use to do some plotting like this in 3D space even a fraction as nice looking as OPs? I'm not a web dev but I am a dev, but would prefer something high enough level that I can focus on the "what" (to plot) rather than the "how".
This strikes me as backwards reasoning.
You are showing "these functions" -> spherical helix
But I actually want spherical helix -> "these functions"
1. What if I want to make some other shape? I'm lost.
2. I have learned nothing about the spherical helix.
If you want a spiral that covers the sphere with evenly spaced samples, consider this approach.
Let's find out where this sentence goes!
> Linux
Would look into that.
> Brave.
Definitely would look into that.
> 32 GiB RAM, Intel i9 w/ 24 cores
This part is not relevant
In both of these cases, mathematically generating the points to visit (in gcode) is needed, and we don't care about constant speed - the firmware handles the instruction->motion part.
I am thinking about non-planar printing mostly, but this could also apply to CNC finishing passes.
Then I realized that, unlike the early web with banners of "best viewed in Netscape navigator", this was an unstated "best viewed in google chrome".
Alas. At least please check and validate if the site works in Firefox, or notify appropriately. Because this demonstrably does not.
y = 10 * sin(πt/2) * sin(0.02 * πt)
On the previous two slides the end is sin(0.2 * πt)
The point that is moving is in the centre of the cube. But the cube's orientation is fixed in global space.
So the cube's orientation relative to the path of the spiral/helix is not quite the same as its orientation relative to the path of the straight line.
Your mission, should you choose to accept it ;-)
https://en.wikipedia.org/wiki/Frenet–Serret_formulas