绘制梯度向量和导数之间的关系

绘制梯度向量和导数之间的关系

我该如何画这个? 在此处输入图片描述

我尝试过,但是没有用,因为我需要虚线,并且需要点 $a, \nabla f(a)$

\documentclass{article}

\usepackage[utf8]{inputenc} % accents
\usepackage{verbatim} % \comment
\usepackage{amsmath,amssymb}
\usepackage{bm} % bold math
\usepackage{multirow,tabularx}
\usepackage{array}   % \newcolumntype 
\newcolumntype{x}[1]{ >{} m{#1} <{} }
\newcolumntype{X}[1]{ >{\[} m{#1} <{\]} }
%\newcolumntype{A}{>{$\begin{aligned}}c{\end{aligned}$}}
\usepackage{tikz}
\usetikzlibrary{angles,quotes}

\tikzstyle{ciangle}=[
    every pic quotes/.append style={text=cyan},
    draw=cyan,
    angle radius=1cm,
  ]
\tikzstyle{sqangle}=[
    every pic quotes/.append style={text=cyan},
    draw=cyan,
    angle radius=1cm,
  ]

\newcommand{\DrawTriangle}[4]{% 
\begin{tikzpicture}  
  \coordinate (A) at (-1.5,-1);
  \coordinate (C) at (1.5,-1);
  \coordinate (B) at (1.5,1);
  \draw (C) -- node[right] {#1} (B) -- node[above] {#3} (A) -- node[below] {#2} (C);
  \pic [ciangle, "#4"] {angle=C--A--B};
%  \pic [ciangle, "#5"] {angle=A--B--C};
  \draw [sqangle](C) rectangle ++(-0.5,0.5);
\end{tikzpicture}
}

\begin{document}


\begin{tabular}{x{3cm} X{1cm}}
\DrawTriangle{$a$}{$b$}{$c$}{$\alpha$} & \textit{sen}(\alpha)=\frac{a}{c} \\
& \textit{cos}(\alpha)=\frac{b}{c} \\
& \textit{tan}(\alpha)=\frac{a}{b}=\frac{\textit{sin}(\alpha)}{\textit{cos}(\alpha)} \\
\end{tabular} 

\end{document}

答案1

\documentclass[a4paper,10pt]{article}
\usepackage{tkz-euclide}
\begin{document}
    
\begin{tikzpicture}
\tkzDefPoints{0/0/a,3/1/y,4/4/B}
\tkzDefPointBy[projection=onto a--y](B)\tkzGetPoint{C}

\tkzDrawSegment(a,C)
\tkzDrawSegment[dashed](B,C)
\tkzDrawSegments[->,thick](a,B a,y)

\begin{scope}[/pgf/decoration/raise=5pt]
\draw [decorate,decoration={brace,mirror,
   amplitude=10pt},xshift=0pt,yshift=-4pt]
(a) -- (C) node [black,midway,yshift=-20pt]
{\footnotesize $f'(a:y)$};
\end{scope}
\tkzLabelPoints[above left](a,y) 
\tkzLabelPoint[right](B){$\nabla f(a)$}
\end{tikzpicture}

\end{document}

在此处输入图片描述

相关内容