I want to plot this semi circle

Code:
%% Plotting The Semi Circle %%
%% Equation %%
%% After solving we came to know that r=wn %%
w_n=2.57;
r=w_n;
%% a is the angle which is 22 degrees %%
a=22;
x=(r*cos(a));
y=(r*sin(a));
%% Final Plot %%
j=plot(x,y,'b')
%% Axis Limit Setting
axis([-3 1 -3 3])
%% Setting Line width
set(j,'LineWidth',3)

 Accepted Answer

I'm not sure where a equals 22 degrees comes from. That semicircle corresponds to an angle of 90 degrees to 270 degrees.
Setting a to a vector like 90:270 gives you a semicircle (and use cosd and sind since the angle is in degrees rather than radians).
%% Plotting The Semi Circle %%
%% Equation %%
%% After solving we came to know that r=wn %%
w_n=2.57;
r=w_n;
%% a is the angle which is 22 degrees %%
% a=22;
a = 90:270;
% x=(r*cos(a));
% y=(r*sin(a));
x = r*cosd(a);
y = r*sind(a);
%% Final Plot %%
j=plot(x,y,'--g'); % '--g' to get a dashed green line
%% Axis Limit Setting
% axis([-3 1 -3 3])
axis([-r-1 1 -r-1 r+1]) % "axes limits should be 1 unit greater than the r ..."
%% Setting Line width
set(j,'LineWidth',3)

2 Comments

Thank you very much
infact a comes from the sin inverse of damping factor for a specific Transfer function as "Theta" is eaual to sine inverse of that damping factor.
Anyways thanks agian ....
You're welcome!

Sign in to comment.

More Answers (0)

Categories

Find more on 2-D and 3-D Plots in Help Center and File Exchange

Asked:

on 10 Jun 2022

Commented:

on 10 Jun 2022

Community Treasure Hunt

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

Start Hunting!