1

I have a computed a value in a variable in my tikz diagram

\def\smax{750}
\def\samb{100}
\def\H{5}
\pgfmathsetmacro\R{H*\sqrt{((\smax*\smax)/(\samb*\samb)-1)}}

I want to display the value of \R in my diagram:

\coordinate [label=right :$R$ = \R] (mmm)      at (5,5);

this does not show/display the numerical value but only the letter 'R'

1 Answers1

2

You mean something like this:

\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{fpu}
\usepackage{xfp}
\begin{document}
    \def\smax{750}
    \def\samb{100}
    \def\H{5}
    %%https://tex.stackexchange.com/questions/417691/dimension-too-large-error-apparently-no-calculation-involved

    \begin{tikzpicture}
            \pgfmathsetmacro\R{\H*\fpeval{(((\smax^2)/(\samb^2))-1)^0.5}}
        \node at (5,5) {R=\R};
    \end{tikzpicture}
\end{document}

to get:

enter image description here

Please note that I have directly used a \node here. However, if you want to stick with \coordinate then, define one and place the \node at that particular \coordinate and continue ;-).