麦克劳林三叉戟

麦克劳林三叉戟

著名曲线的参数化工作方式与代码相同。Desmos 可以正确绘制它,但 Tikz 失败了。这是怎么可能的?

\begin{tikzpicture}[scale=1]
\draw[->](-.5,0)--(3,0);
\draw[->](0,-2)--(0,2);
\draw[thick](1,0)circle(1);
\draw[thick](.5,-2)--(.5,2)node[right]{$v$};
\draw[thick,variable=\x,samples=100,domain=0:3]plot({\x},{\x/2})node[right,above]  {$r$};
\fill[]({8/5},{4/5})circle(1pt)node[above]{$C$};
\fill[]({1/2},{1/4})circle(1pt)node[below,right]{$B$};
\draw[thick,variable=\m,samples=100,domain=-2:2]plot({(3-pow(\m,2))/2* (1+pow(\m,2))},{\m*(3-pow(\m,2))/2*(1+pow(\m,2))});
\end{tikzpicture}

答案1

您缺少括号:

X/*

被解释为第一个除法X经过并将结果乘以。 你要

X/ (*

或者

X//

\documentclass{article}
\usepackage{tikz}

\begin{document}

\begin{tikzpicture}[scale=1]
\draw[->] (-.5,0)--(3,0);
\draw[->] (0,-2)--(0,2);
\draw[thick,color=red!80] (1,0) circle (1);
\draw[thick,color=red!80] (.5,-2)--(.5,2) node[right] {$v$};
\draw[
  thick,
  variable=\x,
  samples=100,
  domain=-1:3,
  color=red!80,
] plot ({\x},{\x/2}) node[right,above] {$r$};
\fill ({8/5},{4/5}) circle (1pt) node[above] {$C$};
\fill ({1/2},{1/4}) circle (1pt) node[below,right] {$B$};
\draw[
  thick,
  variable=\m,
  samples=100,
  domain=-3:3,
] plot ({(3-pow(\m,2))/(2*(1+pow(\m,2)))},{\m*(3-pow(\m,2))/(2*(1+pow(\m,2)))});
\end{tikzpicture}

\end{document}

我添加了颜色来区分曲线和构造线。

在此处输入图片描述

相关内容