I'm positioning an object in 3d space, and I want to make it orbit another object, in a semi-random electron-like orbit, such that it always stays the same distance from the origin. I can make it move in a circle easy enough from high school math:
x: sin( time ),
y: cos( time ),
z: 0
But I'm not sure what the right algorithm is to make correctly orbit the object in a spherical, zig-zaggy electron type path.
Edit2 The back story is I'm testing the effect of a light on a sphere in 3d space. I want the light to orbit the sphere in a pattern that eventually covers most of the surface, so it can't just orbit in a circle. I would like it to orbit in a smooth, visually pleasing path.
Edit3: What I actually want is to make the point follow the path of a circle on a plane, then spin the plane orthogonally.
Ok, I think you are looking for the spherical coordinate system (this also tells you how to convert back to Cartesian coordinates).
The radius is r, and should be constant so that all the points are "on the sphere".
An example I came up with with this:
$r=1$
$\phi = \frac{s}{10}$
$\theta = s$
You could also do something like this:
$r=1$
$\phi = \frac{\pi}{2}+1.1sin(6s)$
$\theta = s$
The quality is horrendous (I sooooooo wish I had Mathematica), but you get the idea.
These aren't random, but they cover most of the surface area.
Good Luck!