
不確定我的問題是什麼。我正在嘗試定義一個函數以便稍後在 3D 繪圖中使用。到目前為止,我已嘗試盡可能簡化程式碼以查找錯誤,因此請意識到這些不是我實際要使用的函數。
\documentclass[12pt]{article}
\usepackage{pgfplots}
\pgfplotsset{compat=1.11}
\begin{document}
\pgfmathdeclarefunction{r}{2}{%
\pgfmathparse{1.6}%
}
\begin{tikzpicture}
\begin{axis}[axis lines=center,view={135}{45}]
\addplot3[surf,variable=\u, variable y=\v,samples=40,
domain=0:1, y domain=-pi:pi]
({r(u,v)},{0},{0});
\end{axis}
\end{tikzpicture
\end{document}
我也嘗試過\tikzset{declare function={r{\a,\b}=1.6;}}
(\begin{tikzpicture}[declare function={r(\a,\b)=1.6;}]
我意識到這是同一件事,但誰知道)。
我遇到的主要錯誤似乎是「!Package PGF Math Error:抱歉,浮點單元的內部例程得到了格式不正確的浮點數」。