フィルターのクリア

Doubt about plotting in Matlab and finding intersect points

2 ビュー (過去 30 日間)
ErikJon Pérez Mardaras
ErikJon Pérez Mardaras 2020 年 10 月 21 日
編集済み: Stephen23 2020 年 10 月 22 日
I have 2 doubts,
Doubt #1
In one hand, I am trying to plot a circle as well as some lines. The problem here is that if I plot the circle alone it draws fine, but if I plot the circle with the lines, the circle deforms to an oval (as I show you in the images attached).
The code I have written for that is that one:
%%% DRAW THE CIRCUNFERENCE
hold on
%x and y are the coordinates of the center of the circle
%r is the radius of the circle
%0.01 is the angle step, bigger values will draw the circle faster but
%you might notice imperfections (not very smooth)
ang=0:0.01:2*pi();
xp=5*cos(ang);
yp=5*sin(ang);
plot(0+xp,0+yp);
%DRAW LINES AT DIFFERENT ANGLE
hold on;
x=linspace(0,100)';
line0=[0*x];
line1=[0.1763*x];
line2=[0.3639*x];
line3=[0.5773*x];
line4=[0.8391*x];
line5=[1.1917*x];
line6=[1.7320*x];
line7=[2.7475*x];
line8=[5.6713*x];
plot(line0);
plot(line1);
plot(line2);
plot(line3);
plot(line4);
plot(line5);
plot(line6);
plot(line7);
plot(line8);
#Doubt #2
In the other hand, I would like to find the intersection points between those lines and the circle.

採用された回答

Stephen23
Stephen23 2020 年 10 月 21 日
編集済み: Stephen23 2020 年 10 月 21 日
"...if I plot the circle with the lines, the circle deforms to an oval"
axis('equal')
  5 件のコメント
ErikJon Pérez Mardaras
ErikJon Pérez Mardaras 2020 年 10 月 21 日
Thanks to both! Cheburashka and Ameer Hamza
Stephen23
Stephen23 2020 年 10 月 21 日
編集済み: Stephen23 2020 年 10 月 22 日
@Ameer Hamza: thank you!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File Exchange2-D and 3-D Plots についてさらに検索

製品


リリース

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by