How to divide an arc?
조회 수: 1 (최근 30일)
이전 댓글 표시
I have a third degree polynomial,which if plotted looks like an arc. I want this arc to be divided into 10 equal parts. Does any matlab function can do it..Please suggest some alternatives...
댓글 수: 0
답변 (3개)
Matt Kindig
2013년 6월 3일
If I understand your question correctly, John D'Errico's interparc ( http://www.mathworks.com/matlabcentral/fileexchange/34874-interparc) is designed to do exactly this.
댓글 수: 0
Walter Roberson
2013년 6월 3일
If the segments are to be divided by length, then you will need to use the arc length formula to determine the total length:
s = integral from a to be of sqrt(1 + (dx/dy)^2) * dx
Divide by the number of segments, and then solve a series of integral equations to find the coordinates, first from "a" to a+s/10, then from a+s/10 to a+2*s/10 and so on.
You probably will not find a closed-form solution for the arc of a third degree polynomial (but perhaps there is one in terms of elliptics; I do not know.)
댓글 수: 0
Roger Stafford
2013년 6월 3일
I suggest you use one of the 'ode' solvers to solve the differential equation:
ds/dx = sqrt(1+(dy/dx)^2)
where y(x) is your polynomial with x ranging over the full extent of your given arc and with s initially zero. For more accuracy, you can specify the fineness of x intervals to be used by the 'ode' solver. This will give you a vector s. You can use 'find' afterwards to find the one-tenth equal intervals in s and thereby determine the corresponding values of x at these points. You may prefer to use interpolation here in obtaining more accurate x values at these nine dividing points.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Numerical Integration and Differential Equations에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!