Filter löschen
Filter löschen

Turning part circle into circle segment

2 Ansichten (letzte 30 Tage)
Klaus Haas
Klaus Haas am 22 Apr. 2015
Bearbeitet: pfb am 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

Antworten (1)

pfb
pfb am 22 Apr. 2015
Bearbeitet: pfb am 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)

Kategorien

Mehr zu Elementary Polygons finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by