Moving a point around a Sphere

1.6k Views Asked by At

I am working on a computer program which involves some fairly complicated rotation/translation math.

The current problem I am having is that I have a point on a sphere, which I want to move around the sphere using a vector.

So, to imagine the problem on a flat surface: I have a point at x = 10, y = 10, I subtract the vector (10,0), so the point is now at x = 0, y = 0.

However, the above will not work on a sphere, since the resulting point will not follow the curvature of the sphere.

What I'm asking for is a solution that takes a point and moves that point around a sphere by a distance and direction given by a vector.

If this is impossible, which it may be, I would settle for a solution which takes a point and moves it around a sphere by an angle.

This solution: How can I rotate a coordinate around a circle Solves the latter problem, but only works in two dimensions, would it be possible to convert this to work in 3 dimensions?

Any advice is appreciated.