# Get coordinates points inside a 3-D circle in MATLAB

2 次查看（过去 30 天）
Ali Sohrabi2022-8-1

Hi there,
I am trying to generate a 3-D circle to get the points inside it and the border. I already have a function to draw and get border points (Christian Reinbacher (2022). Plot Circle in 3D (https://www.mathworks.com/matlabcentral/fileexchange/26588-plot-circle-in-3d), MATLAB Central File Exchange. Retrieved July 31, 2022.) but not sure how to get points inside it. Will be appreciated if someone could help.
normal=[-3.5556 -0.2222 1.0000];
center=[138 146 219];
%Inputs:
% center ---> Centre point of circle
% normal ---> normal vector
theta =0:0.01:2*pi;
v=null(normal);
p = fill3(points(1,:),points(2,:),points(3,:),'r-');
view(3);
end
With this function, I can get border points but not inside points. I know there are infinite points inside, but if I can get many of them, it would be great.
Ali

### 回答（1 个）

Chunru 2022-8-1
normal=[-3.5556 -0.2222 1.0000];
center=[138 146 219];
hold on
point = plotPointOnCircle3D(center,normal,2,pi/3)
point = 3×1
138.4080 147.0125 220.6758
plot3(point(1), point(2), point(3), 'bo') %Inputs:
% center ---> Centre point of circle
% normal ---> normal vector
theta =0:0.01:2*pi;
v=null(normal);
p = fill3(points(1,:),points(2,:),points(3,:),'r-', 'FaceAlpha', 0.5);
view(3);
end
function point = plotPointOnCircle3D(center,normal,radius,theta)
%Inputs:
% center ---> Centre point of circle
% normal ---> normal vector
v=null(normal);
end

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!