How do I plot a line of a fixed length and slope?

2 ビュー (過去 30 日間)
leonnn
leonnn 2015 年 11 月 30 日
回答済み: Thorsten 2015 年 11 月 30 日
I need to plot a line that has some fixed slope at some point, and the length is given, too. How should I do this? Thanks in advance!

回答 (2 件)

Walter Roberson
Walter Roberson 2015 年 11 月 30 日
For a line y = m * x + b, to reach a length of L relative to y = b at x=0, the upper range of x should be L/sqrt(m^2+1)

Thorsten
Thorsten 2015 年 11 月 30 日
slope = 120/180*pi; length = 10; dx = 10; dy = -20;
line([-length/2*cos(slope) length/2*cos(slope)]+dx, [-length/2*sin(slope) length/2*sin(slope)]+dy)

カテゴリ

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