LaTeX - tikz画摆线

\documentclass[border=0,tikz]{standalone}
\usetikzlibrary{arrows.meta}
\usepackage{scalerel} %\scaleobj{1.5}{} 缩放公式大小
\begin{document}
\begin{tikzpicture}
\draw[arrows={-Stealth[length=5pt, inset=4.5pt]}] (-0.55,0) -- (3.75,0)node (xaxis) [below=-0.5mm] {$\scaleobj{0.5}{x}$};
\draw[arrows={-Stealth[length=5pt, inset=4.5pt]}] (0,-0.55) -- (0,1.35)node (yaxis) [left=-0.75mm] {$\scaleobj{0.5}{y}$};
\draw (-0.12,-0.12) node {$\scaleobj{0.5}{o}$};
\draw[color=red,scale=0.25, domain=-1.7:2*4.0, smooth, variable=\t ]
plot ( {2*(\t-sin(\t r))}, {2*(1-cos(\t r))} );
\draw (1.5,0)--(1.5,1)  coordinate[pos=0.5] (a_c);
\draw[line width=0.3pt] (1.48,0.5)--(1.52,0.5);
\draw(1.5,0) -- (a_c) node[midway,right=-1mm] {$\scaleobj{0.45}{a}$};
\draw(a_c) -- (1.5,1) node[midway,right=-1mm] {$\scaleobj{0.45}{a}$};
\draw (0.5,0.5) circle [radius=0.5];
\draw (0.5,0)--(0.5,1)  coordinate[pos=0.5] (a_z);
\draw[line width=0.3pt] (0.48,0.5)--(0.52,0.5);
\draw (0.5,0) -- (a_z) node[midway,right=-1mm] {$\scaleobj{0.45}{a}$};
\draw (a_z) -- (0.5,1) node[midway,left=-1mm] {$\scaleobj{0.45}{a}$};
\end{tikzpicture}
\end{document}

选自 How can I draw this cycloid diagram with TikZ?

\documentclass[pstricks,border=15pt,12pt]{standalone}
\usepackage{fp}
\FPeval\XMin{0-1}
\FPeval\XMax{2*pi+1}

\usepackage{pst-plot,pst-node}
\psset
{
    algebraic,
    linejoin=1,
    labels=none,
    ticks=none,
    dimen=m,
    linecolor=lightgray,
    linewidth=2\pslinewidth,
}

\def\x{(t-sin(t))}
\def\y{(1-cos(t))}

\pstVerb{/I2P {AlgParser cvx exec} bind def}

\def\Atom#1{%
\begin{pspicture}(\XMin,-1)(\XMax,3)
    \psaxes(0,0)(\XMin,-1)(\XMax,3)[$x$,0][$y$,90]
    \pnode(!#1 1){C}
    \pnode(!#1 /t ED \x I2P \y I2P){P}  
    \psparametricplot[linecolor=red]{\XMin}{\XMax}{\x|\y}
    \pscircle[linecolor=blue](C){1} 
    % additional accessories
    \psline(C|0,0)(C)(P)
    \psline[linecolor=green](!#1 0)
    \psarcn[linecolor=green,origin={C}](C){1}{-90}{(P)}
    \pscircle*[linecolor=red](P){2pt}   
    \pscircle*[linecolor=blue](C){2pt}
\end{pspicture}}

\begin{document}
    \multido{\n=0.0+0.1}{21}{\Atom{\n\space Pi mul}}
\end{document}

enter image description here

转载于:https://my.oschina.net/shaodongtang/blog/2252886

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值