by pimlottc · 1y ago · 0 comments
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:
const degrees = Math.PI / 180;
const bearing = 5 * degrees; // or it might be 85 degrees? Not sure off the top of my head
const k = Math.tan(bearing);
const v = 0.001 // some velocity, adjust as needed
const phi = (t) => v*t/Math.sqrt(1 + k*k) // the sqrt is not strictly needed
const theta = (t) => k*Math.ln(Math.tan(phi(t)/2)) // this is the annoying one haha
with outputs, const x = (t) => Math.sin(phi(t)) * Math.cos(theta(t))
const y = (t) => Math.sin(phi(t)) * Math.sin(theta(t))
const z = (t) => Math.cos(phi(t))
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.that was also my first intuition when making this, but turned out making the z function linear won't make it a sphere.
to make a sphere, you have to configure it in a way so that it forms a circle with the other axes. In this vis, its the sin(0.02 * πt) and cos(0.02 * πt) part that do this.
someone makes an interactive version here: https://www.desmos.com/3d/t66etxi1y8 (thanks!) so you can try changing the z function for yourself.
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.