# Why is a missing coordinate considered as 1?

Why is a missing coordinate considered as 1 (and not 0 for example)? Is this by design choice or a simple coincidence?

\documentclass[tikz,border=7pt]{standalone}
\begin{document}
\begin{tikzpicture}
\path[red]
(0,0) node{(0,0)}
(,0)  node{(1,0)}
(0,)  node{(0,1)}
(,)   node{(1,1)}
;
\end{tikzpicture}
\end{document}


Note: This is very useful question for code golfing ;)

• Code golfing your code: (0,0) is superflous. May 10, 2018 at 7:51
• @Ignasi Indeed ;)
– Kpym
May 10, 2018 at 7:57

This is due to how \pgfpointxy{}{} works. When TikZ encounters (...) it basically looks for the typical is it a polar syntax, is it a coordinate system point etc checks and then assumes that it is a regular point. After checking for 3D (x,y,z) syntax, it sends it down to one of those @ populated scan point macros (\tikz@@@parse@regular if I'm not mistaken)

But the actual number comes from this bit

\def\pgfpointxy#1#2{%
\pgfmathparse{#1}%  <============= This is \pgfmathparse{} in our example
\let\pgftemp@x=\pgfmathresult%
\pgfmathparse{#2}%
\let\pgftemp@y=\pgfmathresult%
\pgf@x=\pgftemp@x\pgf@xx% <================So this becomes ={\empty}{current xvec}
\pgf@y=\pgftemp@x\pgf@xy%

Long story short, the coordinate syntax is chewed by \pgfpointxy and the entries become scalar factor to the current x,y vectors. And having no factor is taken as the current unit vector length itself due to TeX dimen register scaling behavior.
• @Kpym More like how \somedimen=\empty\otherdimen works :) This really confused me for a while. May 10, 2018 at 8:46
• Now the question is : Why the result of \pgfmathparse{} is \empty and not 0? This is probably a design choice but it is not very consistent with the manual who says "The result stored in the macro \pgfmathresult is a decimal without units". And empty is not a decimal ;). But it is consistent with the multiplication : product over empty set is 1