필터 지우기
필터 지우기

How to draw a tangent using a point and an angle?

조회 수: 2 (최근 30일)
Neha Sinha
Neha Sinha 2019년 3월 2일
댓글: Star Strider 2019년 3월 4일
I need to draw a tangent from (0,0) with an angle of 89.8412 as shown in the curve. How to do that?
img.PNG

채택된 답변

Star Strider
Star Strider 2019년 3월 2일
Try this:
ad = 89.8412; % Angle (Degrees)
tangline = 200*[0 cosd(ad); 0 sind(ad)];
figure
plot(tangline(1,:), tangline(2,:))
grid
axis([0 2 0 300])
It produces two vectors in the ‘tangline’ matrix, the first row being the x-coordinates and the second row the y-coordinates. It then plots them.
You can check that these are correct with:
Check = atan2d(diff(tangline(2,:)), diff(tangline(1,:)))
It returns the ‘ad’ value.
  댓글 수: 13
Neha Sinha
Neha Sinha 2019년 3월 4일
Thank you so much
Star Strider
Star Strider 2019년 3월 4일
As always, my pleasure!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by