Based on the answer [here](https://topanswers.xyz/tex?q=1537), now I tried with all the points have integer coordinates inside the sphere `x^2+y^2+z^2=25` (except center of sphere)
I tried
```
\documentclass[tikz,border=3mm]{standalone}
\usepackage{tikz-3dplot-circleofsphere}
\usetikzlibrary{3dtools}% https://github.com/marmotghost/tikz-3dtools
\usetikzlibrary{decorations.pathreplacing}%
\begin{document}
\tdplotsetmaincoords{60}{110}
\foreach \mytestT in {(-4, -2, -2), (-4, -2, -1), (-4, -2, 0), (-4, -2, 1), (-4, -2, 2), (-4, -1, -2), (-4, -1, -1), (-4, -1, 0), (-4, -1, 1), (-4, -1, 2), (-4, 0, -2), (-4, 0, -1), (-4, 0, 0), (-4, 0, 1), (-4, 0, 2), (-4, 1, -2), (-4, 1, -1), (-4, 1, 0), (-4, 1, 1), (-4, 1, 2), (-4, 2, -2), (-4, 2, -1), (-4, 2, 0), (-4, 2, 1), (-4, 2, 2), (-3, -3, -2), (-3, -3, -1), (-3, -3, 0), (-3, -3, 1), (-3, -3, 2), (-3, -2, -3), (-3, -2, -2), (-3, -2, -1), (-3, -2, 0), (-3, -2, 1), (-3, -2, 2), (-3, -2, 3), (-3, -1, -3), (-3, -1, -2), (-3, -1, -1), (-3, -1, 0), (-3, -1, 1), (-3, -1, 2), (-3, -1, 3), (-3, 0, -3), (-3, 0, -2), (-3, 0, -1), (-3, 0, 0), (-3, 0, 1), (-3, 0, 2), (-3, 0, 3), (-3, 1, -3), (-3, 1, -2), (-3, 1, -1), (-3, 1, 0), (-3, 1, 1), (-3, 1, 2), (-3, 1, 3), (-3, 2, -3), (-3, 2, -2), (-3, 2, -1), (-3, 2, 0), (-3, 2, 1), (-3, 2, 2), (-3, 2, 3), (-3, 3, -2), (-3, 3, -1), (-3, 3, 0), (-3, 3, 1), (-3, 3, 2), (-2, -4, -2), (-2, -4, -1), (-2, -4, 0), (-2, -4, 1), (-2, -4, 2), (-2, -3, -3), (-2, -3, -2), (-2, -3, -1), (-2, -3, 0), (-2, -3, 1), (-2, -3, 2), (-2, -3, 3), (-2, -2, -4), (-2, -2, -3), (-2, -2, -2), (-2, -2, -1), (-2, -2, 0), (-2, -2, 1), (-2, -2, 2), (-2, -2, 3), (-2, -2, 4), (-2, -1, -4), (-2, -1, -3), (-2, -1, -2), (-2, -1, -1), (-2, -1, 0), (-2, -1, 1), (-2, -1, 2), (-2, -1, 3), (-2, -1, 4), (-2, 0, -4), (-2, 0, -3), (-2, 0, -2), (-2, 0, -1), (-2, 0, 0), (-2, 0, 1), (-2, 0, 2), (-2, 0, 3), (-2, 0, 4), (-2, 1, -4), (-2, 1, -3), (-2, 1, -2), (-2, 1, -1), (-2, 1, 0), (-2, 1, 1), (-2, 1, 2), (-2, 1, 3), (-2, 1, 4), (-2, 2, -4), (-2, 2, -3), (-2, 2, -2), (-2, 2, -1), (-2, 2, 0), (-2, 2, 1), (-2, 2, 2), (-2, 2, 3), (-2, 2, 4), (-2, 3, -3), (-2, 3, -2), (-2, 3, -1), (-2, 3, 0), (-2, 3, 1), (-2, 3, 2), (-2, 3, 3), (-2, 4, -2), (-2, 4, -1), (-2, 4, 0), (-2, 4, 1), (-2, 4, 2), (-1, -4, -2), (-1, -4, -1), (-1, -4, 0), (-1, -4, 1), (-1, -4, 2), (-1, -3, -3), (-1, -3, -2), (-1, -3, -1), (-1, -3, 0), (-1, -3, 1), (-1, -3, 2), (-1, -3, 3), (-1, -2, -4), (-1, -2, -3), (-1, -2, -2), (-1, -2, -1), (-1, -2, 0), (-1, -2, 1), (-1, -2, 2), (-1, -2, 3), (-1, -2, 4), (-1, -1, -4), (-1, -1, -3), (-1, -1, -2), (-1, -1, -1), (-1, -1, 0), (-1, -1, 1), (-1, -1, 2), (-1, -1, 3), (-1, -1, 4), (-1, 0, -4), (-1, 0, -3), (-1, 0, -2), (-1, 0, -1), (-1, 0, 0), (-1, 0, 1), (-1, 0, 2), (-1, 0, 3), (-1, 0, 4), (-1, 1, -4), (-1, 1, -3), (-1, 1, -2), (-1, 1, -1), (-1, 1, 0), (-1, 1, 1), (-1, 1, 2), (-1, 1, 3), (-1, 1, 4), (-1, 2, -4), (-1, 2, -3), (-1, 2, -2), (-1, 2, -1), (-1, 2, 0), (-1, 2, 1), (-1, 2, 2), (-1, 2, 3), (-1, 2, 4), (-1, 3, -3), (-1, 3, -2), (-1, 3, -1), (-1, 3, 0), (-1, 3, 1), (-1, 3, 2), (-1, 3, 3), (-1, 4, -2), (-1, 4, -1), (-1, 4, 0), (-1, 4, 1), (-1, 4, 2), (0, -4, -2), (0, -4, -1), (0, -4, 0), (0, -4, 1), (0, -4, 2), (0, -3, -3), (0, -3, -2), (0, -3, -1), (0, -3, 0), (0, -3, 1), (0, -3, 2), (0, -3, 3), (0, -2, -4), (0, -2, -3), (0, -2, -2), (0, -2, -1), (0, -2, 0), (0, -2, 1), (0, -2, 2), (0, -2, 3), (0, -2, 4), (0, -1, -4), (0, -1, -3), (0, -1, -2), (0, -1, -1), (0, -1, 0), (0, -1, 1), (0, -1, 2), (0, -1, 3), (0, -1, 4), (0, 0, -4), (0, 0, -3), (0, 0, -2), (0, 0, -1), (0, 0, 1), (0, 0, 2), (0, 0, 3), (0, 0, 4), (0, 1, -4), (0, 1, -3), (0, 1, -2), (0, 1, -1), (0, 1, 0), (0, 1, 1), (0, 1, 2), (0, 1, 3), (0, 1, 4), (0, 2, -4), (0, 2, -3), (0, 2, -2), (0, 2, -1), (0, 2, 0), (0, 2, 1), (0, 2, 2), (0, 2, 3), (0, 2, 4), (0, 3, -3), (0, 3, -2), (0, 3, -1), (0, 3, 0), (0, 3, 1), (0, 3, 2), (0, 3, 3), (0, 4, -2), (0, 4, -1), (0, 4, 0), (0, 4, 1), (0, 4, 2), (1, -4, -2), (1, -4, -1), (1, -4, 0), (1, -4, 1), (1, -4, 2), (1, -3, -3), (1, -3, -2), (1, -3, -1), (1, -3, 0), (1, -3, 1), (1, -3, 2), (1, -3, 3), (1, -2, -4), (1, -2, -3), (1, -2, -2), (1, -2, -1), (1, -2, 0), (1, -2, 1), (1, -2, 2), (1, -2, 3), (1, -2, 4), (1, -1, -4), (1, -1, -3), (1, -1, -2), (1, -1, -1), (1, -1, 0), (1, -1, 1), (1, -1, 2), (1, -1, 3), (1, -1, 4), (1, 0, -4), (1, 0, -3), (1, 0, -2), (1, 0, -1), (1, 0, 0), (1, 0, 1), (1, 0, 2), (1, 0, 3), (1, 0, 4), (1, 1, -4), (1, 1, -3), (1, 1, -2), (1, 1, -1), (1, 1, 0), (1, 1, 1), (1, 1, 2), (1, 1, 3), (1, 1, 4), (1, 2, -4), (1, 2, -3), (1, 2, -2), (1, 2, -1), (1, 2, 0), (1, 2, 1), (1, 2, 2), (1, 2, 3), (1, 2, 4), (1, 3, -3), (1, 3, -2), (1, 3, -1), (1, 3, 0), (1, 3, 1), (1, 3, 2), (1, 3, 3), (1, 4, -2), (1, 4, -1), (1, 4, 0), (1, 4, 1), (1, 4, 2), (2, -4, -2), (2, -4, -1), (2, -4, 0), (2, -4, 1), (2, -4, 2), (2, -3, -3), (2, -3, -2), (2, -3, -1), (2, -3, 0), (2, -3, 1), (2, -3, 2), (2, -3, 3), (2, -2, -4), (2, -2, -3), (2, -2, -2), (2, -2, -1), (2, -2, 0), (2, -2, 1), (2, -2, 2), (2, -2, 3), (2, -2, 4), (2, -1, -4), (2, -1, -3), (2, -1, -2), (2, -1, -1), (2, -1, 0), (2, -1, 1), (2, -1, 2), (2, -1, 3), (2, -1, 4), (2, 0, -4), (2, 0, -3), (2, 0, -2), (2, 0, -1), (2, 0, 0), (2, 0, 1), (2, 0, 2), (2, 0, 3), (2, 0, 4), (2, 1, -4), (2, 1, -3), (2, 1, -2), (2, 1, -1), (2, 1, 0), (2, 1, 1), (2, 1, 2), (2, 1, 3), (2, 1, 4), (2, 2, -4), (2, 2, -3), (2, 2, -2), (2, 2, -1), (2, 2, 0), (2, 2, 1), (2, 2, 2), (2, 2, 3), (2, 2, 4), (2, 3, -3), (2, 3, -2), (2, 3, -1), (2, 3, 0), (2, 3, 1), (2, 3, 2), (2, 3, 3), (2, 4, -2), (2, 4, -1), (2, 4, 0), (2, 4, 1), (2, 4, 2), (3, -3, -2), (3, -3, -1), (3, -3, 0), (3, -3, 1), (3, -3, 2), (3, -2, -3), (3, -2, -2), (3, -2, -1), (3, -2, 0), (3, -2, 1), (3, -2, 2), (3, -2, 3), (3, -1, -3), (3, -1, -2), (3, -1, -1), (3, -1, 0), (3, -1, 1), (3, -1, 2), (3, -1, 3), (3, 0, -3), (3, 0, -2), (3, 0, -1), (3, 0, 0), (3, 0, 1), (3, 0, 2), (3, 0, 3), (3, 1, -3), (3, 1, -2), (3, 1, -1), (3, 1, 0), (3, 1, 1), (3, 1, 2), (3, 1, 3), (3, 2, -3), (3, 2, -2), (3, 2, -1), (3, 2, 0), (3, 2, 1), (3, 2, 2), (3, 2, 3), (3, 3, -2), (3, 3, -1), (3, 3, 0), (3, 3, 1), (3, 3, 2), (4, -2, -2), (4, -2, -1), (4, -2, 0), (4, -2, 1), (4, -2, 2), (4, -1, -2), (4, -1, -1), (4, -1, 0), (4, -1, 1), (4, -1, 2), (4, 0, -2), (4, 0, -1), (4, 0, 0), (4, 0, 1), (4, 0, 2), (4, 1, -2), (4, 1, -1), (4, 1, 0), (4, 1, 1), (4, 1, 2), (4, 2, -2), (4, 2, -1), (4, 2, 0), (4, 2, 1), (4, 2, 2)}
{\begin{tikzpicture}[tdplot_main_coords,line join = round,
line cap = round, declare function={R=5;D=7;}]
\path \mytestT\space coordinate (T) %center of circle defined by the intersection
(0,0,0) coordinate (I);
\path [3d coordinate={(myn)=(T)-(I)}];
\pgfmathsetmacro{\myn}{TD("(myn)")}
\pgfmathsetmacro{\myd}{sqrt(TD("(myn)o(myn)"))}
\ifdim\myd pt<0.1pt
\typeout{The distance between the center of the sphere and the center of the
circle is too small. Cannot determine a unique plane.}
\else
\pgfmathsetmacro{\mynn}{1/\myd}
\pgfmathsetmacro{\myez}{TD("\mynn*(\myn)")}
\pgfmathsetmacro{\myex}{normalcandidate(\myez)}
\pgfmathsetmacro{\myey}{TD("(\myez)x(\myex)")}
\path (\myex) coordinate (ex) (\myey) coordinate (ey) (\myez) coordinate (ez);
\begin{scope}[x={(ex)},y={(ey)},z={(ez)},canvas is xy plane at z=0,shift={(T)}]
\path (D,D) coordinate (p1) (D,-D) coordinate (p2)
(-D,-D) coordinate (p3) (-D,D) coordinate (p4);
\end{scope}
\pgfmathsetmacro{\mysd}{screendepth(\myn)}
\pgfmathsetmacro{\myr}{sqrt(R*R-\myd*\myd)}
\pgfmathsetmacro{\myaxisangles}{axisangles("(myn)")}
\pgfmathsetmacro{\myalpha}{{\myaxisangles}[0]}
\pgfmathsetmacro{\mybeta}{{\myaxisangles}[1]}
\pgfmathsetmacro{\mygamma}{sign(\mysd)*asin(\myd/R)}
\tdplotCsDrawCircle[tdplotCsFront/.style={draw=none},
tdplotCsBack/.style={draw=none}]{R}{\myalpha}{\mybeta}{\mygamma}
\pgfmathsetmacro{\mydtest}{veclen(x2d("coffs")-x2d("T"),y2d("coffs")-y2d("T"))}
\ifdim\mydtest pt>2pt
\pgfmathsetmacro{\mygamma}{-1*\mygamma}
\fi
\tikzset{stored path/reset coordinate index}
\tdplotCsDrawCircle[tdplotCsFront/.style={store path=fore},
tdplotCsBack/.style={draw,dashed}]{R}{\myalpha}{\mybeta}{\mygamma}
\begin{scope}[tdplot_screen_coords]
% only for animation
\path (-R-D,-R-D) rectangle (R+D,R+D);
\tikzset{draw sphere/.code={\shade[ball color=white,opacity=0.8] (I) circle[radius=R];},
draw rest/.code={
\ifnum\np>0
\path [stored path/first coordinate of=fore] coordinate (aux-0)
[stored path/last coordinate of=fore] coordinate (aux-1);
\begin{scope}
\clip (p1) -- (p2) -- (p3) -- (p4) -- cycle;
\fill[opacity=0.3,blue,even odd rule]
(p1) -- (p2) -- (p3) -- (p4) -- cycle
let \p0=(aux-0),\p1=(aux-1),\n0={atan2(\y0,\x0)},
\n1={atan2(\y1,\x1)+(\iorder>0?0:360)}
in [stored path/restore path=fore]
arc[start angle=\n1,end angle=\n0,radius=R]
-- cycle;
\end{scope}
\draw[stored path/restore path=fore];
\else
\fill[opacity=0.3,blue,even odd rule]
(p1) -- (p2) -- (p3) -- (p4) -- cycle;
\fi
}}
\pgfmathtruncatemacro{\np}{tikztdindexoflastcoordinate}
\pgfmathtruncatemacro{\iorder}{sign(\mysd)}
\ifnum\iorder=1
\tikzset{draw sphere,draw rest}
\else
\tikzset{draw rest,draw sphere}
\fi
\end{scope}
\fi
\end{tikzpicture}}
\end{document}
```
I get the massage
![ScreenHunter 983.png](/image?hash=df2306e163c7418b6a5fc27fd9f6a63395ccaa662b67c95e4ceee376a2da8b91)
I think, if I remove the ractangle, massage will also remove.
Given a sphere of radius R around a center C, a point P inside the sphere, and a normal vector n, how can one draw a circle on the sphere with center P and normal n distinguishing hidden and visible stretches.