
Como a xslant
operação de transformação de coordenadas é tikz
definida matematicamente?
Por exemplo, deixe A = (x_0, y_0)
e xslant = k
. Qual é a expressão matemática para a coordenada transformada B = (x_1, y_1)
?
Quero entender como funciona o exemplo do manual pgf:
\begin{tikzpicture}
\draw[help lines] (0,0) grid (3,2);
\draw (0,0) -- (1,1) -- (1,0);
\draw[xslant=2,blue] (0,0) -- (1,1) -- (1,0);
\draw[xslant=-1,red] (0,0) -- (1,1) -- (1,0);
\end{tikzpicture}
Responder1
Como Mark Wibrow diz em seu comentário, xslant=k
substitua x
por x+k*y
.
Portanto, é um atalho para cm={1,0,k,1,(0,0)}
.
\begin{tikzpicture}[myxslant/.style={cm={1,0,#1,1,(0,0)}}]
\draw[help lines] (0,0) grid (3,2);
\draw (0,0) -- (1,1) -- (1,0);
\draw[myxslant=2,blue] (0,0) -- (1,1) -- (1,0);
\draw[myxslant=-1,red] (0,0) -- (1,1) -- (1,0);
\end{tikzpicture}
OBSERVAÇÃO :Existe umbug na documentaçãode cm
(PGF 2.0, 2.1 e 3.0): a matriz é a transposta do que afirma.