How to draw a tangent using a point and an angle?
5 次查看(过去 30 天)
显示 更早的评论
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](https://www.mathworks.com/matlabcentral/answers/uploaded_files/206534/img.png)
0 个评论
采纳的回答
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 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!