将值表示半径的点集映射到半径为 R 的圆

Map set of points which values represent a radius to a circle with radius R

我有一组代表半径的数据点。我的阈值半径是 R。如果我的数据点的半径 < R 或半径 > R,我想用 Matlab 直观地显示它。

我已经成功地绘制了圆(使用圆的方程),但是我的数据点绘制在圆的外面,即使它们的值小于 R。我认为我没有正确映射数据点。

我正在做以下事情:

%% Circle %%
% Radius = 1;
tx = linspace(-1,1,100);  %% X-data
ty = sqrt(1-tx.^2);      %% Y-data
ty2 = -ty;                %% (-)Y-data
%% Data Points %%
list_radius =[0.5870 0.2077 0.3012 0.4709 1.1524 6.7545 1.5581 1.8074];
%% PLOT %%
plot(tx,ty,':r',tx,ty2,':r')
hold on 
plot(list_radius)
hold off

我期待看到圆内 list_radius < 1 的点和圆外 list_radius > 1 的点。 感谢您的帮助!

我建议你绘制圆,生成 xy 点,圆的

x = R·cos(Θ)

y = R·sin(Θ)

其中 Theta 是一个从 0 到 2*pi 的向量,R 是你想要的半径。使用这个等式,您不必生成矢量 ty2,您可以使用一个绘图命令绘制圆。

R = 1;
theta = linspace(0,2*pi,1000);

tx = R*cos(theta);
ty = R*sin(theta);

list_radius =[0.5870 0.2077 0.3012 0.4709 1.1524 6.7545 1.5581 1.8074];

plot(tx,ty,':r');
hold on;
plot(list_radius,zeros(1,numel(list_radius)),'*');
axis equal

根据这个片段,我假设您的 list_radius 点位于 x 轴上。