The center of the circle is at o and its radius is $r$. So, any general point on the surface of the sphere is given by $\mathbf{p} = \mathbf{o} +r \mathbf{\hat{e}}$, where $\mathbf{\hat{e}}$ is the radial unit vector in spherical co-ordinates.
In Cartesian coordinates, $\mathbf{\hat{r}} =\sin{\theta}\cos{\phi} \mathbf{\hat{i}} + \sin{\theta}\sin{\phi}\mathbf{\hat{j}} + \cos{\theta} \mathbf{\hat{j}}$ where $\mathbf{\hat{i}},\mathbf{\hat{j}},\mathbf{\hat{k}}$ are unit vectors along X,Y,Z directions respectively.
So, what you are looking for is $dist(\mathbf{m,p})$ If you already know the point $\mathbf{p}$, just find out this distance.
In order to plot this function , just vary $\theta$ from $0$ to $180$ degrees and $\phi$ from $0$ to $360$ degrees to cover the whole circle and find out $dist(\mathbf{m,p})$ for all the points. Store the values in an array and plot them.
Let me know if you need code in MATLAB or some other language.