フィルターのクリア

Intersecting Two Lines with Varying Angle

3 ビュー (過去 30 日間)
Erkin Karatas
Erkin Karatas 2019 年 12 月 8 日
コメント済み: Erkin Karatas 2019 年 12 月 9 日
Hi all,
I want to plot two intersecting lines, the most important point of the part is the angle of intersection. The angle between the lines depend on
L = 15.24;
F = 5;
S =20;
D = 10.16;
R = 146;
theta = 2* atan(((L-F)*S) / (D*R))
As I change the variables above, the angle of intersection of two lines should change. The lines are just for visual their values in the x-y axis do not represent anything.
Thank you

採用された回答

Turlough Hughes
Turlough Hughes 2019 年 12 月 8 日
So I understand you just want to plot two lines where there is a specific angle between them. If we take one line as line y=0, you could plot them as follows:
plot([-D*R D*R],[-(L-F)*S (L-F)*S])
axis([-1 1 -1 1]) % set axis limits, this shows 2 units on x and y axis and they have a 1:1 ratio
set(gcf,'Position',[100 100 400 400]) % This is to adjust the figure size with corresponding 1:1 ratio.
hold on, plot([-1 1],[0 0],'-k'), title(['theta = ' num2str(theta,'%.2f') ' radians']) %show angle in title
  2 件のコメント
Turlough Hughes
Turlough Hughes 2019 年 12 月 9 日
Did this help/work for you?
Erkin Karatas
Erkin Karatas 2019 年 12 月 9 日
yes thanks

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeAnnotations についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by