著名曲线的参数化工作方式与代码相同。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}
我添加了颜色来区分曲线和构造线。