作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
假设(x(t),y(t))具有极坐标(√t,2πt)。绘制 t∈[0,10] 的 (x(t),y(t))。
R 中没有适当的函数来用极坐标进行绘图。我尝试通过给出 x=√t & y=2πt 来绘制正态图。但结果图并不符合预期。
我从“使用 r 进行科学编程和模拟简介”中得到了这个问题,这本书告诉我情节应该是螺旋式的。
最佳答案
创建一个序列:
t <- seq(0,10, len=100) # the parametric index
# Then convert ( sqrt(t), 2*pi*t ) to rectilinear coordinates
x = sqrt(t)* cos(2*pi*t)
y = sqrt(t)* sin(2*pi*t)
png("plot1.png");plot(x,y);dev.off()
这不会显示连续字符,因此请添加线条来连接序列中的相邻点:
png("plot2.png");plot(x,y, type="b");dev.off()
关于r - 如何在R中绘制极坐标?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29193499/
我是一名优秀的程序员,十分优秀!