I am trying to draw the circle passing through three points `A,O,O'` and three points `A, C, C'`. I tried ``` \documentclass[12pt]{standalone} \usepackage{tikz-3dplot-circleofsphere} \usetikzlibrary{3dtools} \begin{document} \tdplotsetmaincoords{70}{150} \begin{tikzpicture}[scale=1,tdplot_main_coords,declare function={a=3;R=a*sqrt(2);r=a;Angle=acos(r/R); }] \path (0,0,0) coordinate (C) ({a*sqrt(3)},0,0) coordinate (B) ({a*sqrt(3)/2},a/2,0) coordinate (A) ({a*sqrt(3)/2},-a/2,0) coordinate (O) (0,0,2*a) coordinate (C') ({a*sqrt(3)},0,2*a) coordinate (B') ({a*sqrt(3)/2},a/2,2*a) coordinate (A') ({a*sqrt(3)/2},-a/2,2*a) coordinate (O') ({a*sqrt(3)/2},-a/2,a) coordinate (I) ; \foreach \p in {A,B,C,O,A',B',C',O',I} \draw[fill=black] (\p) circle (1.5 pt); \foreach \p/\g in {A/90,B/90,C/90,O/90,A'/90,B'/90,C'/90,O'/90,I/60} \path (\p)+(\g:3mm) node{$\p$}; \foreach \X in {A,B,C,O} \draw[dashed] (\X) -- (\X'); \draw[dashed] (A) --(B) -- (O) -- (C) -- cycle (A') --(B') -- (O') -- (C') -- cycle (O) -- (A) (O') -- (A') ; \begin{scope}[tdplot_screen_coords] \draw[thick] (I) circle (R); \end{scope} \begin{scope}[shift={(I)}] \tdplotCsDrawLatCircle[tdplotCsFront/.style={thick}]{R}{{-Angle}} \tdplotCsDrawLatCircle[tdplotCsFront/.style={thick,blue}]{R}{{Angle}} \end{scope} \pic[draw=none,dashed]{3d circle through 3 points={A={(A)},B={(C)},C={(C')}}}; \begin{scope}[shift={(I)}] \path[overlay] [3d coordinate={(A-C)=(A)-(C)}, 3d coordinate={(A-C')=(A)-(C')}, 3d coordinate={(myn)=(A-C)x(A-C')}, 3d coordinate={(A-M)=(A)-(M)}]; \pgfmathsetmacro{\myaxisangles}{axisangles("(myn)")} \pgfmathsetmacro{\myalpha}{{\myaxisangles}[0]} \pgfmathsetmacro{\mybeta}{{\myaxisangles}[1]} \pgfmathsetmacro{\mygamma}{acos(sqrt(TD("(A-M)o(A-M)"))/R)} \tdplotCsDrawCircle[tdplotCsFront/.style={thick}]{R}{\myalpha}{\mybeta}{\mygamma} \end{scope} \end{tikzpicture} \tdplotsetmaincoords{70}{150} \begin{tikzpicture}[scale=1,tdplot_main_coords,declare function={a=3;R=a*sqrt(2);r=a;Angle=acos(r/R); }] \path (0,0,0) coordinate (C) ({a*sqrt(3)},0,0) coordinate (B) ({a*sqrt(3)/2},a/2,0) coordinate (A) ({a*sqrt(3)/2},-a/2,0) coordinate (O) (0,0,2*a) coordinate (C') ({a*sqrt(3)},0,2*a) coordinate (B') ({a*sqrt(3)/2},a/2,2*a) coordinate (A') ({a*sqrt(3)/2},-a/2,2*a) coordinate (O') ({a*sqrt(3)/2},-a/2,a) coordinate (I) ; \foreach \p in {A,B,C,O,A',B',C',O',I} \draw[fill=black] (\p) circle (1.5 pt); \foreach \p/\g in {A/90,B/90,C/90,O/90,A'/90,B'/90,C'/90,O'/90,I/60} \path (\p)+(\g:3mm) node{$\p$}; \foreach \X in {A,B,C,O} \draw[dashed] (\X) -- (\X'); \draw[dashed] (A) --(B) -- (O) -- (C) -- cycle (A') --(B') -- (O') -- (C') -- cycle (O) -- (A) (O') -- (A') ; \begin{scope}[tdplot_screen_coords] \draw[thick] (I) circle (R); \end{scope} \begin{scope}[shift={(I)}] \tdplotCsDrawLatCircle[tdplotCsFront/.style={thick}]{R}{{-Angle}} \tdplotCsDrawLatCircle[tdplotCsFront/.style={thick,blue}]{R}{{Angle}} \end{scope} \pic[draw=none,dashed]{3d circle through 3 points={A={(A)},B={(O)},C={(O')}}}; \begin{scope}[shift={(I)}] \path[overlay] [3d coordinate={(A-O)=(A)-(O)}, 3d coordinate={(A-O')=(A)-(O')}, 3d coordinate={(myn)=(A-O)x(A-O')}, 3d coordinate={(A-M)=(A)-(M)}]; \pgfmathsetmacro{\myaxisangles}{axisangles("(myn)")} \pgfmathsetmacro{\myalpha}{{\myaxisangles}[0]} \pgfmathsetmacro{\mybeta}{{\myaxisangles}[1]} \pgfmathsetmacro{\mygamma}{acos(sqrt(TD("(A-M)o(A-M)"))/R)} \tdplotCsDrawCircle[tdplotCsFront/.style={thick}]{R}{\myalpha}{\mybeta}{\mygamma} \end{scope} \end{tikzpicture} \end{document} ```  The circle `A,C,C'` correct and the circle `A, O, O'` incorrect. Where is wrong in above code?