add tag
Laurenso
I copy this number from the Maple's soft.
```
sqrt((a^4*m^4 - 2*m^2*(b^2*n^2 + c^2*p^2)*a^2 + b^4*n^4 - 2*b^2*c^2*n^2*p^2 + c^4*p^4)/(a^4*m^2 + ((c^2 - m^2 - n^2)*b^2 + (-m^2 - p^2)*c^2 + m^4 + (-n^2 - p^2)*m^2 + n^2*p^2)*a^2 + b^4*n^2 + ((-n^2 - p^2)*c^2 + (-n^2 + p^2)*m^2 + n^4 - n^2*p^2)*b^2 + c^2*(p^2*c^2 + (n^2 - p^2)*m^2 - n^2*p^2 + p^4)))/2
```
and I put it in 
```
\pgfmathsetmacroFPU{\myr}{sqrt((a^4*m^4 - 2*m^2*(b^2*n^2 + c^2*p^2)*a^2 + b^4*n^4 - 2*b^2*c^2*n^2*p^2 + c^4*p^4)/(a^4*m^2 + ((c^2 - m^2 - n^2)*b^2 + (-m^2 - p^2)*c^2 + m^4 + (-n^2 - p^2)*m^2 + n^2*p^2)*a^2 + b^4*n^2 + ((-n^2 - p^2)*c^2 + (-n^2 + p^2)*m^2 + n^4 - n^2*p^2)*b^2 + c^2*(p^2*c^2 + (n^2 - p^2)*m^2 - n^2*p^2 + p^4)))/2}
```
I use it in this code to draw a sphere.
```
\documentclass[12pt]{standalone}
\usepackage{tikz,tikz-3dplot}
\usetikzlibrary{fpu,calc}
\def\pgfmathsetmacroFPU#1#2{\begingroup%
	\pgfkeys{/pgf/fpu,/pgf/fpu/output format=fixed}%
	\pgfmathsetmacro{#1}{#2}%
	\pgfmathsmuggle#1\endgroup}%
\begin{document}
\tdplotsetmaincoords{70}{70}
\begin{tikzpicture}[tdplot_main_coords,line cap=butt,line join=round,c/.style={circle,fill,inner sep=1pt},
declare function={a=3;b=3;c=3;m=3;n=3;p=3;}]
\begin{scope}[/pgf/fpu,/pgf/fpu/output format=fixed]
\path
(0,0,0) coordinate (A)
				(c,0,0) coordinate (B)
				({(pow(b,2) + pow(c,2) - pow(a,2))/(2*c)},{sqrt((a+b-c) *(a-b+c) *(-a+b+c)* (a+b+c))/(2*c)},0) coordinate (C)
				(barycentric cs:A=1,B=1,C=1) coordinate (G)
				({(c^2 + m^2 - n^2)/(2*c)},{(-c^4 + (a^2 + b^2 + m^2 + n^2 - 2*p^2)*c^2 + (m - n)*(m + n)*(a - b)*(a + b))/(2*sqrt(-(a + b - c)*(a - b + c)*(a - b - c)*(a + b + c))*c)},{-1*sqrt((a - b + c)*(a - b - c)*(a + b + c)*(b^2*n^4 + ((a^2 - b^2 - c^2)*p^2 + (-b^2 + m^2)*c^2 + b^4 + (-a^2 - m^2)*b^2 - a^2*m^2)*n^2 + c^2*p^4 + (c^4 + (-a^2 - b^2 - m^2)*c^2 - a^2*m^2 + b^2*m^2)*p^2 + ((b^2 - m^2)*c^2 + m^2*(a^2 - b^2 + m^2))*a^2)*(a + b - c))/(a^4 - 2*a^2*b^2 - 2*a^2*c^2 + b^4 - 2*b^2*c^2 + c^4)})  coordinate (S)
( {c/2},{c*(a^2 + b^2 - c^2)/(2*sqrt(-(a + b - c)*(a - b + c)*(a - b - c)*(a + b + c)))},{-1*(a^4*m^2 + 2*a^2*b^2*c^2 - a^2*b^2*m^2 - a^2*b^2*n^2 - a^2*c^2*m^2 - a^2*c^2*p^2 + b^4*n^2 - b^2*c^2*n^2 - b^2*c^2*p^2 + c^4*p^2)/(2*sqrt((a^4 - 2*a^2*b^2 - 2*a^2*c^2 + b^4 - 2*b^2*c^2 + c^4)*(a^4*m^2 + a^2*b^2*c^2 - a^2*b^2*m^2 - a^2*b^2*n^2 - a^2*c^2*m^2 - a^2*c^2*p^2 + a^2*m^4 - a^2*m^2*n^2 - a^2*m^2*p^2 + a^2*n^2*p^2 + b^4*n^2 - b^2*c^2*n^2 - b^2*c^2*p^2 - b^2*m^2*n^2 + b^2*m^2*p^2 + b^2*n^4 - b^2*n^2*p^2 + c^4*p^2 + c^2*m^2*n^2 - c^2*m^2*p^2 - c^2*n^2*p^2 + c^2*p^4)))})coordinate (T);
\pgfmathsetmacroFPU{\myr}{sqrt((a^4*m^4 - 2*m^2*(b^2*n^2 + c^2*p^2)*a^2 + b^4*n^4 - 2*b^2*c^2*n^2*p^2 + c^4*p^4)/(a^4*m^2 + ((c^2 - m^2 - n^2)*b^2 + (-m^2 - p^2)*c^2 + m^4 + (-n^2 - p^2)*m^2 + n^2*p^2)*a^2 + b^4*n^2 + ((-n^2 - p^2)*c^2 + (-n^2 + p^2)*m^2 + n^4 - n^2*p^2)*b^2 + c^2*(p^2*c^2 + (n^2 - p^2)*m^2 - n^2*p^2 + p^4)))/2}
\end{scope}
\draw [dashed] (A) -- (C) (S) --(G);
\draw (S) -- (A) (S) -- (B) (S) -- (C) (A) -- (B) -- (C);			
\path foreach \p/\g in {A/-90,B/-90,C/-90,S/90,G/-90,T/0}{(\p)node[c]{}+(\g:2.5mm) node{$\p$}};
	\draw[tdplot_screen_coords] (T) circle [radius = \myr];		
		\end{tikzpicture}
\end{document}
```
But I can not get the result. How can I get the resutl?
Top Answer
samcarter
If you define a macro inside a scope

```
\begin{scope}
\pgfmathsetmacroFPU{\myr}{...}
\end{scope}
```

it will only be useable inside this scope. The easiest workaround seems to be to draw your circle inside the scope:

```
\documentclass[12pt]{standalone}
\usepackage{tikz,tikz-3dplot}
\usetikzlibrary{fpu,calc}
\def\pgfmathsetmacroFPU#1#2{\begingroup%
	\pgfkeys{/pgf/fpu,/pgf/fpu/output format=fixed}%
	\pgfmathsetmacro{#1}{#2}%
	\pgfmathsmuggle#1\endgroup}%
\begin{document}
\tdplotsetmaincoords{70}{70}
\begin{tikzpicture}[tdplot_main_coords,line cap=butt,line join=round,c/.style={circle,fill,inner sep=1pt},
declare function={a=3;b=3;c=3;m=3;n=3;p=3;}]
\begin{scope}[/pgf/fpu,/pgf/fpu/output format=fixed]
\path (0,0,0) coordinate (A)
				(c,0,0) coordinate (B)
				({(pow(b,2) + pow(c,2) - pow(a,2))/(2*c)},{sqrt((a+b-c) *(a-b+c) *(-a+b+c)* (a+b+c))/(2*c)},0) coordinate (C)
				(barycentric cs:A=1,B=1,C=1) coordinate (G)
				({(c^2 + m^2 - n^2)/(2*c)},{(-c^4 + (a^2 + b^2 + m^2 + n^2 - 2*p^2)*c^2 + (m - n)*(m + n)*(a - b)*(a + b))/(2*sqrt(-(a + b - c)*(a - b + c)*(a - b - c)*(a + b + c))*c)},{-1*sqrt((a - b + c)*(a - b - c)*(a + b + c)*(b^2*n^4 + ((a^2 - b^2 - c^2)*p^2 + (-b^2 + m^2)*c^2 + b^4 + (-a^2 - m^2)*b^2 - a^2*m^2)*n^2 + c^2*p^4 + (c^4 + (-a^2 - b^2 - m^2)*c^2 - a^2*m^2 + b^2*m^2)*p^2 + ((b^2 - m^2)*c^2 + m^2*(a^2 - b^2 + m^2))*a^2)*(a + b - c))/(a^4 - 2*a^2*b^2 - 2*a^2*c^2 + b^4 - 2*b^2*c^2 + c^4)})  coordinate (S)
( {c/2},{c*(a^2 + b^2 - c^2)/(2*sqrt(-(a + b - c)*(a - b + c)*(a - b - c)*(a + b + c)))},{-1*(a^4*m^2 + 2*a^2*b^2*c^2 - a^2*b^2*m^2 - a^2*b^2*n^2 - a^2*c^2*m^2 - a^2*c^2*p^2 + b^4*n^2 - b^2*c^2*n^2 - b^2*c^2*p^2 + c^4*p^2)/(2*sqrt((a^4 - 2*a^2*b^2 - 2*a^2*c^2 + b^4 - 2*b^2*c^2 + c^4)*(a^4*m^2 + a^2*b^2*c^2 - a^2*b^2*m^2 - a^2*b^2*n^2 - a^2*c^2*m^2 - a^2*c^2*p^2 + a^2*m^4 - a^2*m^2*n^2 - a^2*m^2*p^2 + a^2*n^2*p^2 + b^4*n^2 - b^2*c^2*n^2 - b^2*c^2*p^2 - b^2*m^2*n^2 + b^2*m^2*p^2 + b^2*n^4 - b^2*n^2*p^2 + c^4*p^2 + c^2*m^2*n^2 - c^2*m^2*p^2 - c^2*n^2*p^2 + c^2*p^4)))})coordinate (T);
\pgfmathsetmacroFPU{\myr}{sqrt((a^4*m^4 - 2*m^2*(b^2*n^2 + c^2*p^2)*a^2 + b^4*n^4 - 2*b^2*c^2*n^2*p^2 + c^4*p^4)/(a^4*m^2 + ((c^2 - m^2 - n^2)*b^2 + (-m^2 - p^2)*c^2 + m^4 + (-n^2 - p^2)*m^2 + n^2*p^2)*a^2 + b^4*n^2 + ((-n^2 - p^2)*c^2 + (-n^2 + p^2)*m^2 + n^4 - n^2*p^2)*b^2 + c^2*(p^2*c^2 + (n^2 - p^2)*m^2 - n^2*p^2 + p^4)))/2}
\draw [dashed] (A) -- (C) (S) --(G);
\draw (S) -- (A) (S) -- (B) (S) -- (C) (A) -- (B) -- (C);			
	\draw[tdplot_screen_coords] (T) circle [radius = \myr];		
  \end{scope}
  \path foreach \p/\g in {A/-90,B/-90,C/-90,S/90,G/-90,T/0}{(\p)node[c]{}+(\g:2.5mm) node{$\p$}};
		\end{tikzpicture}
\end{document}  
```

![document-000001.png](/image?hash=39216a133db40dc2f2f543cb7fd61ba4c0c8a72d2459e42cea4c5bb4c9d6c0b9)

Enter question or answer id or url (and optionally further answer ids/urls from the same question) from

Separate each id/url with a space. No need to list your own answers; they will be imported automatically.