この図をラテックスを使用して描画するにはどうすればよいでしょうか?

この図をラテックスを使用して描画するにはどうすればよいでしょうか?

固体摩擦によって償却される振動子

この図をLaTexで描くにはどうすればいいでしょうか?

答え1

このサイトには、このタイプの図がすでにかなりたくさん存在しますが、patterns.metaパターンをより簡単に制御できる はまだ存在しないかもしれません。(anglesライブラリを使用することもできますが、1 つのアークに対しては少々やりすぎかもしれません。)

\documentclass[tikz,border=3mm]{standalone}
\usetikzlibrary{decorations.pathmorphing,patterns.meta} 
\pgfdeclarepattern{
name=shatch, parameters={\hatchsize,\hatchangle,\hatchlinewidth}, 
bottom left={\pgfpoint{-.1pt}{-.1pt}},
top right={\pgfpoint{\hatchsize+.1pt}{\hatchsize+.1pt}}, tile size={\pgfpoint{\hatchsize}{\hatchsize}},
tile transformation={\pgftransformrotate{\hatchangle}}, code={
\pgfsetlinewidth{\hatchlinewidth} 
\pgfpathmoveto{\pgfpoint{-.1pt}{\hatchsize/2}} 
\pgfpathlineto{\pgfpoint{\hatchsize+.1pt}{\hatchsize/2}} 
\pgfusepath{stroke}
} }
\tikzset{
hatch size/.store in=\hatchsize,
hatch angle/.store in=\hatchangle,
hatch line width/.store in=\hatchlinewidth, 
hatch size=5pt,
hatch angle=0pt,
hatch line width=.5pt,
}
\begin{document}
\begin{tikzpicture}[declare function={beta=30;},>=stealth,semithick]
 \begin{scope}[rotate=-beta]
  \path[pattern=shatch] (0,0) rectangle (-0.4,1.2); 
  \draw[<->] (0,2) node[right] {$y$} |- (6,0) node[right]{$x$}
   coordinate[pos=0.95](x);
  \draw[decorate,decoration={zigzag,segment length=4mm,amplitude=2mm}]
   (0,0.2) -- (4,0.2) node[midway,above=2ex]{$(k,\ell)$};
  \draw[fill=cyan] (3.8,0) rectangle ++ (0.6,0.4); 
  \path (4.1,0.5) node[above right] {$M(m)$};
 \end{scope}
 \draw (x) -- ++ (-5,0);
 \draw (x) + (-2,0) arc[start angle=180,end angle=180-beta,radius=2]
  node[midway,left] {$\beta$};
 \draw[<-] (3,2) -- ++ (0,1); 
 \draw[->] (3.1,2.6) -- ++ (0.5,0) node[midway,below] {$g$}; 
\end{tikzpicture}
\end{document}

ここに画像の説明を入力してください

関連情報