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!