Calculating a distance between a point and a contour along an axis
3 次查看(过去 30 天)
显示 更早的评论
I would like to implement an code to realiyze the calculation between a point and a countour of an cloud point along the x axis in 2D (blue line).
The lines are drawn with line() and the redpoint is only temporary.
After that, I would like to make a code to calculate a distance with any angle (green line).
Could anyone give me a tip or help me for that?
Thank you in advance.
0 个评论
采纳的回答
KSSV
2022-6-30
Let O(x,y) be your red point.
If you want to draw a line of length L with angle a w.r.t horizontal i.e. blue line.
%L is the length of line and a is angle
x2=x+(L*cos(a));
y2=y+(L*sin(a));
plot([x x2],[y y2])
7 个评论
Matt J
2022-6-30
@Minyoung Hong if KSSV's answer led to a solution for you, you should Accept-click it.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Contour Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!