如何在 Matlab 中找到构成任意半径圆的边缘的点矩阵?如果我绘制这些点,我应该得到一个接近圆的东西(尽管一个光滑的圆是由无限数量的点组成的)。
问问题
1834 次
1 回答
2
radius = 5; %desired radius
numPoints = 1000; %Number of points in your circle
angles = linspace(0,2*pi,numPoints)'; %Angles evenly spread around the circle, from 0 to 2*pi radians
xyCircle = radius*[cos(angles) sin(angles)]; %This is the matrix you probably want
plot(xyCircle(:,1), xyCircle(:,2),'.'); %Quick plot to check the result
axis equal;
于 2013-01-09T20:38:32.310 回答