在 Julia 中绘制一组具有多个参数的参数方程

标签 plot julia parametric-equations

要绘制以 (1, 1) 为中心的半径为 2 的圆,我执行以下操作:

θ = 0:0.1:2π
x = 1 .+ 2cos.(θ)
y = 1 .+ 2sin.(θ)
plot(x, y, aspect_ratio=:equal)

但是,如果我想绘制一组具有两个以上参数的参数方程,则无法使用这种方法。一种方法应该如何在 Julia 中绘制具有多个参数的参数方程?例如,如何绘制由参数方程描述的锥体

x = r*cos(θ)
y = r*sin(θ)
z = r

rθ是参数吗?

我想像下图所示的最终图是通过输入 ParametricPlot3D[{r*Cos[t], r*Sin[t], r}, {r, -3 , 3}, {t, 0, 2*Pi}] 在 Mathematica 中。

enter image description here

最佳答案

这适用于 plotlypyplot 后端到 Plots 但不适用于 gr:

X(r,theta) = r * cos(theta)
Y(r,theta) = r * sin(theta)
Z(r,theta) = r

rs = range(0, 2, length=50)
ts = range(0, 2pi, length=50)

surface(X.(rs',ts), Y.(rs', ts), Z.(rs', ts))

关于在 Julia 中绘制一组具有多个参数的参数方程,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56919909/

相关文章:

python - Matplotlib 图 '.supxlabel' 不起作用

r - 如何在 Mac 上的 R 中设置 png 的分辨率

multidimensional-array - Julia 跳跃 : define a multidimensional variable when a dimension depends on other dimension

vector - 如何将参数方程转换为笛卡尔形式

matlab - 如何对补丁边缘进行着色(使用颜色图)?

r - 如何使用 R(最好是 ggplot2)生成堆叠平面或重叠钻石的图形?

ipython - 我在哪里/如何轻松托管交互式 Julia ipython 笔记本?

installation - 是否有 Julia 和 Atom 组合的稳定版本可以按照说明进行安装?

c++ - 将贝塞尔曲线解构为具有等间距斜率的线段