
數學上如何定義xslant
座標變換運算tikz
?
例如,讓A = (x_0, y_0)
和xslant = k
。變換後的座標的數學表達式是什麼B = (x_1, y_1)
?
我想了解 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}
答案1
正如 Mark Wibrow 在他的評論中所說,xslant=k
替換x
為x+k*y
.
所以它是一個捷徑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}
筆記 :有一個文件中的錯誤( cm
PGF 2.0、2.1 和 3.0):矩陣是其所聲明內容的轉置。