Get a point around a point on a sphere I have a point on a sphere, which I got the 3D Cartesian coordinates for using:
$$x = r\sin\phi\cos\theta$$
$$y = r\sin\phi\sin\theta$$
$$z = r\cos\phi$$
which led me to this (let $r=1$)
$$\phi=\arccos(z)$$
$$\theta = \arccos\left(\frac x {\sin\phi}\right)$$
EDIT: Sorry I forgot to mention! the radius is 1 so the $r$ cancels out
(Please correct me if I am wrong)
So after having all this information I am trying to do this:
Given a point $p$ on a sphere, generate a point $p'$ that is around the point $p$ with a given distance $d$.
I tried generating $(x,y,z)$ points with just adding and subtracting from $\phi$ and $\theta$ but it doesn't seem to generate the right points (at least not what I am looking for)
Sorry if what I am asking is a bit vague, let me try to visualize what I am trying to do:

(By the way, the black circle is $d$ distance from $p$ at any point on the circle (along the surface of the sphere))
The point of all this is to generate the normal at that point (At least close to the normal).
EDIT: I know the normal at a point $p$ on a sphere is just normalizing $p$ but I want to consider the fact that the sphere is not really a sphere but a spherical terrain
If there is a better solution this is problem I'll be glad to hear it! :)
Thanks in advance and if I am missing any info let me know!
 A: Spherical coordinates are useful for organizing points on a sphere.
However, when it come to geometric operations on a generic point on sphere, it is usually not that easy to use.
For this particular problem, it will be easier to describe the new point using vectors. 
The underlying idea is use a new coordinate system where point $p$
is along the $z'$-axis (i.e $p$ becomes $(0,0,1)$), the points $q$ at an angular distance $d$ from $p$ now has the form
$$q = (x',y',z') = (\sin(d)\cos(t),\sin(d)\sin(t),\cos(d)),\quad t \in [0,2\pi)$$
We don't really need to the figure out what the new coordinate system is. What we
need is the two unit vectors pointing along the $x'$ and $y'$ directions.
The recipe has been mentioned in answer.
Treat point $p$ as an unit vector $\hat{p}$ , take a random vector $\vec{r}$ not parallel to $\hat{p}$, let $\vec{u}$ be the vector $\vec{r}−(\hat{p}\cdot\vec{r})\hat{p}$ and $\hat{u} = \frac{\vec{u}}{|\vec{u}|}$. $\hat{u}$ will be an unit vector orthogonal to $\hat{p}$. Let $\hat{v} = \hat{p} \times \hat{u}$ and the three vectors $\hat{u}, \hat{v}, \hat{p}$ will define the $x'$,$y'$ and $z'$-direction in the new coordinate system.
The point $q$ at an "angular" distance $d$ to $p$ now has the form 
$$\hat{q} = \hat{p}\cos(d) + \sin(d)(\hat{u}\cos(t) + \hat{v}\sin(t)),\quad t \in [0,2\pi]$$
