The following code shows an offset of the calculate point when I use the scale=1.25.
I have the possibility to use transform canvas={scale=1.25} with a scope but this leads to other difficulties like the need to create a bounding box manually.
This is very annoying because on a complex geometrical construction the shifts can combine and result in a false figure.
In general this happens as soon as distance calculations are used.
Is there a way to avoid this problem?
\documentclass[landscape]{article}
\usepackage{tikz,fullpage}
\usetikzlibrary{calc}
\begin{document}
\parindent=0pt
\begin{tikzpicture}
\drawhelp lines grid (18,1);
\coordinate(A) at (0,0);
\coordinate(C) at (10,0);
\coordinate(B) at (6,0);
\path (A) -- (B) coordinatepos=.5;
\path (B) -- (C) coordinatepos=.5;
\path[coordinate] let
\p1 = ($ (B) - (E) $),
\n1={veclen(\x1,\y1)},
\p2 = ($ (B) - (F) $),
\n2={veclen(\x2,\y2)},
in (barycentric cs:E={-\n2/1cm},F={\n1/1cm}) coordinate (D);
\foreach \point in {A,B,C,D,E,F}
\fill [black,opacity=.5] (\point) circle (2pt);
\end{tikzpicture}
\vspace{1cm}
\begin{tikzpicture}[scale=1.25]
\drawhelp lines grid (18,1);
\coordinate(A) at (0,0);
\coordinate(C) at (10,0);
\coordinate(B) at (6,0);
\path (A) -- (B) coordinatepos=.5;
\path (B) -- (C) coordinatepos=.5;
\path[coordinate] let
\p1 = ($ (B) - (E) $),
\n1={veclen(\x1,\y1)},
\p2 = ($ (B) - (F) $),
\n2={veclen(\x2,\y2)},
in (barycentric cs:E={-\n2/1cm},F={\n1/1cm}) coordinate (D);
\foreach \point in {A,B,C,D,E,F}
\fill [black,opacity=.5] (\point) circle (2pt);
\end{tikzpicture}
\vspace{1cm}
\begin{tikzpicture}
\begin{scope}[transform canvas={scale=1.25}]
\drawhelp lines grid (18,1);
\coordinate(A) at (0,0);
\coordinate(C) at (10,0);
\coordinate(B) at (6,0);
\path (A) -- (B) coordinatepos=.5;
\path (B) -- (C) coordinatepos=.5;
\path[coordinate] let
\p1 = ($ (B) - (E) $),
\n1={veclen(\x1,\y1)},
\p2 = ($ (B) - (F) $),
\n2={veclen(\x2,\y2)},
in (barycentric cs:E={-\n2/1cm},F={\n1/1cm}) coordinate (D);
\foreach \point in {A,B,C,D,E,F}
\fill [black,opacity=.5] (\point) circle (2pt);
\end{scope}
\useasboundingbox (0,0) rectangle (18,1);
\end{tikzpicture}
\end{document}


transform canvaseverything is scaled, which I do not want (line thickness, fonts etc.) and thebounding boxis lost. The good way is to improve some calculations, or even to avoid them. The pgf maintainers have given me some ideas. The problem after ascaleis that rounding errors are propagated and sometimes their accumulation is a problem. The very good solution would be to do the calculations only withlua. – Alain Matthes Mar 19 '22 at 14:06