示例 3 步,在同一个会话中按顺序运行。每一步都在引擎上执行过,下面的输出就是它实际产生的。
nf = Nearest[Table[{t Sin[t], t Cos[t]} -> t, {t, 5}]]Nearest[{{Sin[1], Cos[1]} -> 1, {2*Sin[2], 2*Cos[2]} -> 2, {3*Sin[3], 3*Cos[3]} -> 3, {4*Sin[4], 4*Cos[4]} -> 4, {5*Sin[5], 5*Cos[5]} -> 5}]DensityPlot[First[nf[{x, y}]], {x, -5, 5}, {y, -5, 5}]-Graphics-DensityPlot[First[nf[{x, y}]], {x, -5, 5}, {y, -5, 5}, PlotPoints -> 100]-Graphics-全部操作示例 · 函数参考 · 从 MCP 客户端使用