Methods to calculate curvature

90 次查看(过去 30 天)
L_Del
L_Del 2019-6-25
回答: L_Del 2019-6-25
Hi all,
I am trying to calculate the curvature of a series of points. The distance in x between those points is never the same. The distance (in x,y) also varies between 0 and 1.
The problem: Sometimes, when the distance (in x,y) is really small (0.1) , the curvature (respectively the radius) of a straight line becomes too big (respectively small) when it should be the opposite. I think the distance in x,y or perhaps just in x should stay the same for it to work. But I can't be really sure. Does the distance play that big a role? Could it be linked to noise in the series of points? If so, what should I do to get accurate results?
Thank you in advance for your help.
Regards,
LD
  2 个评论
Jan
Jan 2019-6-25
Please explain this sentence: "the curvature (respectively the radius) of a straight line becomes too big (respectively small) when it should be the opposite" The curvature of a straight line should be 0, so I do not understand "too big" and "respectively small". 0.1 does not sound "really small".
Of course noise influence the results. For a line, which is expected to be straight, a curvature different from 0 is even dominated by noise. So please post more details, preferrably some data, which demonstrate the observed effect.
L_Del
L_Del 2019-6-25
Thank you for your post. I got things mixed up. Sorry about that.
Here is the output data which shows the issues I'm experiencing. I have to host it on dropbox for confidentiality reasons. It'll have to be removed once we figure this out.
The two first fields are the x and y coordinates, the third one is the distance in x,y , the fourth one is the calculated radius between the previous and the next points using this function. The last field is the speed obtained with v=sqrt(Acceleration*Radius).
NB: - You can plot x and y to visualise the path.
- I have to fix a few bugs for example at row 220,221 etc... but this isn't related to my issue.
- The distance between two following points decreases. I used Bezier curves to model my path . Here is the code I used. Each time a new Bezier curve is used, the distance suddenly gets bigger before decreasing slowly.
For example, the point at row #245 has an associated speed of 47m/s, which is small because the radius is small. The radius shouldn't be small at this point as it's on a straight line.

请先登录,再进行评论。

回答(1 个)

L_Del
L_Del 2019-6-25
I think the problem might come from the fact that the x values are not evenly spaced out. I did a test with a simple sine curve and was able to get proper radii. For this test, the distance in x was the same for every point as I used linspace to define the x values...
If so, how can I create a new matrix from the existing data with x values evenly spaced out? I tried interp1 without success...

类别

Help CenterFile Exchange 中查找有关 Scatter Plots 的更多信息

标签

产品


版本

R2019a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by