Hi guys. I'm trying to simulate ( with a computer program ) the movement of an object on a sphere. The data are as this : The sphere has a radius R and it's center is at (0,0,0). There is an object at point P(x0,y0,z0) or in polar coordinates defined as P(phi,theta). The object can rotate around it's own axis ( at the tangent plane of the sphere in the point (x0,y0,z0) and it can move by a distance "dist" along the great circle ( geodesic ) defined by the point P and the direction of the rotation around its axis. My problem is to define the equations that govern this type of movement.

What i have done till now is this :

i defined an angle called "chi" which is the direction the object is "looking at", the rotation around its axis. i also have a "unit" vector which let's say vec=(0,0,1) which gets added to the P thus producing the new point P1. I have the rotation matrix of a point around an axis and this is fine. The problem is each time the object moves, "vec" must rotate appropriately so that it is perpendicular to the vector P. Any help would be appreciated.

thank you in advance