Azzera filtri
Azzera filtri

Turning part circle into circle segment

2 visualizzazioni (ultimi 30 giorni)
Klaus Haas
Klaus Haas il 22 Apr 2015
Modificato: pfb il 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

Risposte (1)

pfb
pfb il 22 Apr 2015
Modificato: pfb il 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)

Categorie

Scopri di più su Elementary Polygons in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by