Effacer les filtres
Effacer les filtres

Turning part circle into circle segment

2 vues (au cours des 30 derniers jours)
Klaus Haas
Klaus Haas le 22 Avr 2015
Modifié(e) : pfb le 22 Avr 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

Réponses (1)

pfb
pfb le 22 Avr 2015
Modifié(e) : pfb le 22 Avr 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)

Catégories

En savoir plus sur Elementary Polygons dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by