As we know that in TikZ, if unit is not mentioned in the coordinate in TikZ, it takes cm by default.
When I extract the coordinates, I was expecting the unit as cm. But TikZ shows the unit in the coordinate as pt.
How does TikZ determine the unit of measure in a coordinate if no unit is specified.
MWE:
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{decorations.pathmorphing}
\usetikzlibrary{decorations.markings}
\usetikzlibrary{calc}
\usetikzlibrary{positioning}
\tikzset{zigzag/.style={decorate,decoration=zigzag}}
\begin{document}
\newdimen\XCoord
\newdimen\YCoord
\newcommand*{\ExtractCoordinate}[1]{\path (#1); \pgfgetlastxy{\XCoord}{\YCoord};}
\begin{tikzpicture}
\coordinate (c) at (0,-2);
\coordinate (d) at (4,-2);
\coordinate (e) at (2,-4);
\draw[thick,red,zigzag,postaction={
decoration={
markings,
mark=at position 0.7 with { \coordinate (x); },
mark=at position 0.5 with { \coordinate (singularity); },
},
decorate
}] (-2,0) coordinate(a) -- (2,0) coordinate(b);
\draw[thick,fill=blue!20] (c) -- (b) -- (d) -- (e) -- cycle;
\draw[thick,postaction={
decoration={
markings,
mark = at position 0.7 with \coordinate (y);
},
decorate
}] (a) -- (c);
\draw[thick,red,dashed] (x) -- (y);
\node[above = 10ex of singularity,red] (sn) {singularity};
\draw[red,->] (sn) -- ($(singularity)+(0,1)$);
\ExtractCoordinate{x};
\node[above] at (\XCoord,\YCoord) {(\XCoord,\YCoord)};
\end{tikzpicture}
\end{document}


(x,y), then this vector will becomex e_x + y e_ywheree_x=(1cm,0)ande_y=(0,1cm)by default. On the other hand, if you say something like[xshift=7]then this will produce a shift by7pt. So, in a way, for vectorial quantities the default are cm (in the above sense). Effectively1in\draw circle(1);gets also interpreted as1cm. But I cannot express it better than LoopSpace in https://tex.stackexchange.com/a/31606/121799, especially in a comment. – Feb 28 '19 at 03:50cm. But it is expressed aspt. Which is surprising to me. – subham soni Feb 28 '19 at 04:13calcsyntax is done inptunless you explicitly instruct TikZ to behave differently. You can convert the distances in cm if you want, of course. Is this what you are asking? – Feb 28 '19 at 04:16calcthe unit of measure changes fromcmtopt. Right? – subham soni Feb 28 '19 at 04:22(2,1), you specify a point in pgf’s xy-coordinate system. By default, the unit x-vector goes 1cm to the right and the unit y-vector goes 1cm upward. (p.122, pgfmanual, v3.1.1) – Paul Gaborit Feb 28 '19 at 07:28