Maybe you are interested in making ProbXpos
in a function that can be used inside a coordinate.
The extra pair of braces are needed as ProbXpos(…)
contains parentheses itself.
You could also use a definition as in
\newcommand{\ProbXpos}[1]{{log10(#1/(1-#1))}}
which can be used inside a coordinate, too.
But it can not be modified, i.e. (2*\ProbXpos{…}, 0)
, because it already contains the braces.
Then again, we could leave out the extra pair of braces, but then we need to use { }
in the coordinate.
Code (declare function
variant)
\documentclass[tikz]{standalone}
\begin{document}
\begin{tikzpicture}[declare function={ProbXpos(\x)=log10(\x/(1-\x));}]% could be global …
\draw (0,1) node {\pgfmathparse{ProbXpos(0.1)}\pgfmathresult\ result prints ok} ;
\draw ({ProbXpos(.0001)},0) -- ({ProbXpos(0.9999)},0);
\end{tikzpicture}
\end{document}
Code (PGF math function)
\documentclass[tikz]{standalone}
\makeatletter
\pgfmathdeclarefunction{ProbXpos}{1}{%
\begingroup
\pgfmathparse{log10(#1/(1-#1))}%
\pgf@x=\pgfmathresult pt\relax
\pgfmathreturn\pgf@x
\endgroup
}
\makeatother
\begin{document}
\begin{tikzpicture}
\draw (0,1) node {\pgfmathparse{ProbXpos(0.1)}\pgfmathresult\ result prints ok} ;
\draw ({ProbXpos(.0001)},0) -- ({ProbXpos(0.9999)},0);
\end{tikzpicture}
\end{document}
Output (declare function
/PGF math function)

Code (LaTeX macro)
\documentclass[tikz]{standalone}
\newcommand{\ProbXpos}[1]{log10(#1/(1-#1))}
\begin{document}
\begin{tikzpicture}
\draw (0,1) node {\ProbXpos{0.1} result prints ok} ;
\draw ({\ProbXpos{.0001}},0) -- ({\ProbXpos{0.999}},0);
\end{tikzpicture}
\end{document}
Output (LaTeX macro)

ln 10
as in the logarithm of the base 10? It's calledlog10(x)
, or is the constant value ofln(10)
actually meant?