How do I plot a line of a fixed length and slope?
조회 수: 2 (최근 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!
댓글 수: 0
답변 (2개)
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)
댓글 수: 0
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)
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Annotations에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!