how to plot this ?

3 Ansichten (letzte 30 Tage)
diadalina
diadalina am 21 Apr. 2019
Kommentiert: KSSV am 23 Apr. 2019
i have a circle and i want to plot his half radius in the same figure can anyone help me :
angle=linspace(0,2*pi,360);
x=cos(angle);
y=sin(angle);
plot(x,y)
axis('equal')
  3 Kommentare
diadalina
diadalina am 21 Apr. 2019
thank mr walter for your response, i mean by his half radius, the line that cuts its half radius
Walter Roberson
Walter Roberson am 21 Apr. 2019
Which angle should it be drawn at?

Melden Sie sich an, um zu kommentieren.

Antworten (1)

KSSV
KSSV am 22 Apr. 2019
angle=linspace(0,2*pi,360)';
C = [0 0] ;
R = 1 ;
x=C(1)+R*cos(angle);
y=C(2)+R*sin(angle);
%
x1 = R/2*cos(angle) ;
y1 = R/2*sin(angle) ;
plot(x,y)
hold on
C1 = repmat(C,length(angle),1) ;
plot([C1(:,1) x1]',[C1(:,2) y1]')
axis('equal')
  4 Kommentare
diadalina
diadalina am 22 Apr. 2019
thank you mr walter for your help ;
KSSV
KSSV am 23 Apr. 2019
angle=linspace(0,2*pi,360)';
C = [0 0] ;
R = 1 ;
x=C(1)+R*cos(angle);
y=C(2)+R*sin(angle);
%
x1 = R*cos(0) ;
y1 = R*sin(0) ;
plot(x,y)
hold on
plot([C(:,1) x1]',[C(:,2) y1]')
axis('equal')

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu 2-D and 3-D Plots finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by