Tikz 中线性代数可视化中的标志

Tikz 中线性代数可视化中的标志

有人可以帮我在 Tikz 中编写这个代码吗?

在此处输入图片描述

答案1

试试这个:
你可能需要稍微调整一下
你需要以某种方式将 V_3 的标签放在前面
并改变颜色
输出:
tikz 图

\documentclass[tikz,border=10pt]{standalone}
\usepackage{tikz}

\begin{document}
\begin{tikzpicture}[scale=1, every node/.style={scale=1}]
  % Define the 3D view
  \begin{scope}[x={(2cm,0cm)},y={({cos(30)*0.7cm},{sin(30)*0.7cm})}, z={({cos(70)*1cm},{sin(70)*1cm})}, line join=round, fill opacity=0.8, thick]
  
    % Draw V_0 and c
    \node at (0,1,0) {$\bullet$};
    \node at (0.3,1,0) {$V_0$};
    \node at (0.6,1,0) {$c$};
    
    % Adjust the forward slash to be more upright
    \draw[line width=0.5pt] (1.3, 0.5, -0.6) -- (1.2, 1.5, 1);
    
    % Draw V_1 and c
    \node at (1.5,1,0) {$V_1$};
    \node at (1.8,1,0) {$c$};
    
    % Draw the blue parallelogram labeled V_2 (front face of the 3D parallelogram)
    \draw[fill=blue!25!white] (2.2,0,0) -- (2.5,0,0) -- (2.5,0,1) -- (2.2,0,1) -- cycle; % Bottom face
    \node at (1.76,2.5,-0.45) {$V_2$};
    
    % Draw c
    \node at (2.5,1.3,0) {$c$};

    \node at (3.4,0,1) {$V_3$};
    
    % Draw the 3D parallelogram
    \draw[fill=blue!40!white] (3.1,0,0) -- (3.4,0,0) -- (3.4,0.7,0) -- (3.1,0.7,0) -- cycle; % Base face
    \draw[fill=blue!30!white] (3.1,0.7,0) -- (3.4,0.7,0) -- (3.4,0.7,1) -- (3.1,0.7,1) -- cycle; % Top face
    \draw[fill=blue!20!white] (3.4,0,0) -- (3.4,0,1) -- (3.4,0.7,1) -- (3.4,0.7,0) -- cycle; % Side face
    \draw[fill=blue!15!white] (3.1,0,0) -- (3.1,0,1) -- (3.1,0.7,1) -- (3.1,0.7,0) -- cycle; % Other side face
    \draw[fill=blue!25!white] (3.1,0,0) -- (3.4,0,0) -- (3.4,0,1) -- (3.1,0,1) -- cycle; % Bottom face
    \draw[fill=blue!35!white] (3.1,0.7,1) -- (3.4,0.7,1) -- (3.4,0,1) -- (3.1,0,1) -- cycle; % Rear face
    
    % Draw c and ellipsis
    \node at (3.7,1.3,0) {$c$};
    \node at (4,1.3,0) {...};

  \end{scope}
\end{tikzpicture}
\end{document}

答案2

您可以创建一些 TiZ 图片并将base文本节点的锚点与周围文本的基线对齐:

\documentclass[border=10pt]{standalone}
\usepackage{tikz}

\begin{document}

\tikz[baseline=(n.base)]{
    \fill circle[radius=1pt]
        node[midway, right] (n) {$V_{0}$};
}

$\subset$

\tikz[baseline=(n.base), xslant=0.33]{
    \draw (0,-0.5) -- (0,0.5)
        node[midway, right] (n) {$V_{1}$};
}

$\subset$

\tikz[baseline=(n.base), xslant=0.33]{
    \draw[fill=blue, fill opacity=0.25] 
        (-0.5,-0.5) rectangle (0.5,0.5)
        node[midway, opacity=1] (n) {$V_{2}$};
}

$\subset$

\tikz[baseline=(n.base), xslant=0.33]{
    \path[shift={(0.25,0.25)}]
        (-0.5,-0.5) coordinate (a) 
            rectangle (0.5,0.5) coordinate (b);
    \path (-0.5,-0.5) coordinate (c) 
            rectangle (0.5,0.5) coordinate (d);
    \draw[blue!50!black, opacity=0.5] 
        (a |- b) |- (a -| b)
        (a) -- (c) (b) -- (d);
    \fill[blue, fill opacity=0.25]
        (c) -- (c |- d) -- (a |- b) -- (b) -- 
        (a -| b) -- (c -| d) -- cycle;
    \draw[fill=blue, fill opacity=0.25]
        (c) rectangle (d);
    \draw (c |- d) -- (a |- b) -- (b) -- 
        (a -| b) -- (c -| d);
    \path
        (-0.5,-0.5) -- (0.5,0.5)
        node[midway, opacity=1] (n) {$V_{3}$};
}

$\subset$

\tikz[baseline=(n.base), xslant=0.33]{
    \path[shift={(0.25,0.25)}]
        (-0.5,-0.5) coordinate (a) 
            rectangle (0.5,0.5) coordinate (b);
    \path (-0.5,-0.5) coordinate (c) 
            rectangle (0.5,0.5) coordinate (d);
    \path[shift={(0.25,0.25)}]
        (-0.25,-0.25) coordinate (e) 
            rectangle (0.25,0.25) coordinate (f);
    \path (-0.25,-0.25) coordinate (g) 
            rectangle (0.25,0.25) coordinate (h);
    \draw[blue!50!black, opacity=0.5] 
        (a |- b) |- (a -| b)
        (a) -- (c) (b) -- (d)
        (e) rectangle (f)
        (g) rectangle (h)
        (e |- f) -- (g |- h)
        (e -| f) -- (g -| h)
        (e) -- (g) (f) -- (h)
        (a |- b) -- (e |- f)
        (a -| b) -- (e -| f)
        (c |- d) -- (g |- h)
        (c -| d) -- (g -| h);
        % omitting some edges as they are invisible due to perspective
    \fill[blue, fill opacity=0.25]
        (c) -- (c |- d) -- (a |- b) -- (b) -- 
        (a -| b) -- (c -| d) -- cycle;
    \draw[fill=blue, fill opacity=0.25]
        (c) rectangle (d);
    \draw (c |- d) -- (a |- b) -- (b) -- 
        (a -| b) -- (c -| d);
    \path
        (-0.5,-0.5) -- (0.5,0.5)
        node[midway, opacity=1] (n) {$V_{4}$};
}

$\subset \quad \cdots$

\end{document}

在此处输入图片描述

相关内容