I want to compute pure ratios of distances in a \path let construction; for example, in the document fragment
\path let \p1 = (1cm, 2cm), \n1 = {\y1 / \x1} in ...
I would like \n1 to be the number 2, not the string 2pt, which is what TikZ actually writes because the computation involves a unit somewhere, even though they cancel out. One bad solution is to write \expandafter\strip@pt\n1 everywhere, but is there a way to signal to the PGF math engine that \ifpgfmathunitsdeclared (which controls this decision and is set somewhere inside \pgfmathparse) should be let to \iffalse? I'm imagining a construction like
\path let \p1 = (1cm, 2cm), \n1 = {nounits(\y1 / \x1)} in ...
or some other thing that can be placed inside the math expression itself.
\pgfextra{\pgfmathsetmacro\ratio{\y1/x1}}to the path (afterin). – Caramdir Jun 8 '11 at 15:39\def\m{\expandafter\expandafter\expandafter\strip@pt\n}and then use\m1instead. – Martin Scharrer♦ Jun 8 '11 at 15:39