How to get angle two curved line, which is pinned at a point?
조회 수: 4 (최근 30일)
이전 댓글 표시
Suppose there is a flexible line is moving and then it meets with some points and pinned to that points and then bow-out with some radius say R ,, now I want to calculate the angle formed.I have attached a figure.Please have a look.
댓글 수: 0
채택된 답변
Image Analyst
2013년 9월 20일
Do you have all the points coordinates along the curve? Can't you just find the vertex and then use polyfit() to get the line to the right and left and then get the angle? Here's a start
% Fit left line between x indexes k1 and k2.
coeffsLeft = polyfit(x(k1:k2), y(k1:k2), 1);
% Fit right line between x indexes k3 and k4.
coeffsRight = polyfit(x(k3:k4), y(k3:k4), 1);
yLeft = polyval(coeffsLeft, x(k1));
yRight = polyval(coeffsRight, x(k4));
% Then calculate angle
댓글 수: 0
추가 답변 (1개)
Roger Stafford
2013년 9월 20일
If d is the distance between the two points on the left of your picture, then
phi = 2*acos(d/2/r);
for the phi that you show.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Surface and Mesh Plots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!