Turning part circle into circle segment

1 view (last 30 days)
Klaus Haas
Klaus Haas on 22 Apr 2015
Edited: pfb on 22 Apr 2015
Hi,
i got a part of a circle like this
n = 60;
% the circle "Kreis" in the xy-plane:
v = linspace(pi/4,7*pi/4 , n);
r = 60;
Kreis = [r*cos(v)+60;
r*sin(v);
0*v] ;
How can I close the circle with a straight line without adding an extra "object", so that the whole circle segment is "Kreis" in the end?
greets

Answers (1)

pfb
pfb on 22 Apr 2015
Edited: pfb on 22 Apr 2015
I'd add a final point coincident with the first one
Kreis=[Kreis Kreis(:,1)];
Then
plot3(Kreis(1,:),Kreis(2,:),Kreis(3,:))
or
fill3(Kreis(1,:),Kreis(2,:),Kreis(3,:),'b');
give the figure you're asking for.
You can do this also by redefining the grid as
v = [linspace(pi/4,7*pi/4 , n) pi/4];
(no need of adding the extra point, now)

Community Treasure Hunt

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

Start Hunting!