I have nodes on a parametric path and I want to know witch node is the furthest from (0,0). I tried this ugly thing :
\documentclass[a4paper]{article}
\usepackage[marginparsep=3pt, top=2cm, bottom=1.5cm, left=1.5cm, right=1.5cm]{geometry}
\usepackage{tikz}
\usetikzlibrary{calc,intersections}
\tikzset{small dot/.style={fill=black,circle,scale=0.3},}
\newcommand{\CoorXY}[1]{%
\pgfmathsetmacro\PjX{3*cos(\A)}
\pgfmathsetmacro\PjY{5*sin(\A)}
\node[small dot,label={[font=\scriptsize]#1}] at (\PjX,\PjY) {}
}
\begin{document}
\begin{tikzpicture}
\def\tmpB{0}
\def\Max{0}
\foreach \A in {0,10,...,360} {
\CoorXY{\A} ;
\pgfmathparse{veclen(\PjX,\PjY)} ;
\let\tmpA\pgfmathresult ;
\pgfmathifthenelse{\tmpA>\tmpB}{\A}{\Max} ;
\let\Max\pgfmathresult ;
\pgfmathifthenelse{\tmpA>\tmpB}{\tmpA}{\tmpB} ;
\let\tmpB\pgfmathresult ;
\message{Max \tmpB pour \Max}
}
\end{tikzpicture}
\end{document}
but it is not working. Any idea why, and there is certainly a better idea. Thank you.

\documentclassand the appropriate packages that sets up the problem. – Peter Grill Feb 26 '14 at 00:34\CoorXY, it does not include the required packages. While solving problems can be fun, setting them up is not. Then, those trying to help can simply cut and paste your MWE and get started on solving the problem. – Peter Grill Feb 26 '14 at 00:51