Orbiting a point in $\mathbb{R}^3$ I have been studying some computer graphics and found a problem related to orbital camera positioning and I am just lost trying to solve it. Here is the freely translated problem statement:

Let $A$ and $B$ be two points in the $R^3$ space that are distanced to
  each other by $r$ units. Let $\vec{u}$ and $\vec{v}$ be two perpendicular vectors
  contained in a plane $P$ which contains $B$ and is perpendicular to
  the vector $\vec{AB}$.
Given two real numbers, $t$ and $s$, that range from $-r$ to $r$, $B$
  must be translated $t$ units in the direction of the vector $\vec{u}$ and
  $s$ units in the direction of the vector $\vec{v}$, then translated to it's
  projection on the sphere $S$ with center in $A$ and radius $r$.
Find the equation that gives the resulting coordinates of point $B$
  after being moved from a known initial position with respect to $t$
  and $s$ obeying the behavior described.

My approach so far:
Define a basis with the vectors $\vec{u}$, $\vec{v}$ and $\vec{AB}$ and make $A$ be at the origin. Then I can easily find the projection of $B$ in the sphere $S$ as the height of that point, in my custom base, is $t$ itself, the position along $y$ axis will be $s$ itself and the position along $x$ axis will be $r*sqrt(1-t^2)$.
Now I have the resulting coordinates of $B$ with respect to my custom defined base. I have now to apply the transformation matrix to get the coordinates of $B$ in the usual base. I did that and implemented in OpenGL to test... it didn't work the camera moved a little bit, but was constrained to a small portion os the sphere $S$ and didn't seem to obey correctly the $t$ and $s$ parameters (used the mouse movement for them).
I believe my code is ok, the problem is likely in my approach. Can someone help me?
 A: I started with the same coordinate system as you but I did it in a different order (I think).  As you did, let $A$ be the origin of $\mathbb{R}^3$ and let $B$ be a point on the $z$ axis (vertical) with coordinate $(0, 0, r)$.  I understand now there are two vectors, $u$, $v$, perpendicular to each other and $AB$.  

B must be translated t units in the direction of the vector u⃗  and s units in the direction of the vector v⃗ , ...

The location I get for the resulting point is
$$\vec{w} = (0, 0, r) + t\vec{u} + s\vec{v}$$

then translated to it's projection on the sphere S with center in A and radius r.

Now we must project the point above onto the sphere of radius $r$ with center $A$.  Since $A$ is the origin this amounts to normalizing the length of the vector $\vec{w}$ above and then multiplying it by $r$.  The length of the $\vec{w}$ (since $u$, $v$, $AB$ are perpendicular) is
$$||w|| = \sqrt{r^2 + t^2||u||^2 + s^2||v||^2}$$
Therefore the formula for the final vector is
$$r\left(\frac{(0, 0, r) + t\vec{u} + s\vec{v}}{\sqrt{r^2 + t^2||u||^2 + s^2||v||^2}}\right)$$
