簡體   English   中英

阿基米德螺旋上的等距點

[英]Equally spaced points on archimedian spiral

我知道如何繪制阿基米德螺旋線

a <- 20 #distance from origin
b <- 1 #distance between loops
maxtheta <- 20*pi  #10 times round the loop

theta <- seq(0,maxtheta,0.01) #my sequence of angles
r <- a + b*theta # equation for the spiral

df <- data.frame(x=r*cos(theta), y=r*sin(theta)) # convert points to Cartesian coordinates
#then plot them to get spiral

此外,我還想在螺旋上繪制均勻分布的點,但到目前為止我的點總是不等間距。

您可以使用模塊化數學系統地選擇行。

plot(df, pch=20, cex=.1, asp=1)
points(df[seq_len(nrow(df)) %% 50 == 0, ], pch=20, col='red')

在此處輸入圖像描述

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM