【发布时间】:2017-03-09 19:26:13
【问题描述】:
我想得到R中一个圆上等距n个点的坐标。
Mathematically the solution is: exp((2*pi * i)*(k/n)) 其中 0
有很多 SOF 问题可以处理这个问题。所有解决方案都在非 R 环境中:
Evenly distributing n points on a sphere(提出java、python解决方案)
Generating points on a circle(非 R 解决方案)
calculate pixel coordinates for 8 equidistant points on a circle(python解决方案)
drawing points evenly distributed on a circle(非 R 解决方案)
How to plot points around a circle in R(没有同等距离)
Coordinates of every point on a circle's circumference(非 R 解决方案)
Coordinates of points dividing circle into n equal halves in Pebble
How to efficiently draw exactly N points on screen?(python解决方案)
Approximate position on circle for n points(非 R 解决方案)
Determining Vector points on a circle
我为解决方案做了什么:
# For 4 points, 0<=k<4
exp((2*pi*sqrt(-1))*(0/4)); exp((2*pi*sqrt(-1))*(1/4)); exp((2*pi*sqrt(-1))*(2/4)); exp((2*pi*sqrt(-1))*(3/4))
复数 i 没有在 R 中定义。没有与 pi (3.14) 相反的常数。模拟 i 的技巧 sqrt(-1) 不起作用;错误:
[1] NaN
Warning message: In sqrt(-1) : NaNs produced
【问题讨论】:
标签: r geometry coordinates evenly