Curvature of a 1D curve in a 2D or 3D space

版本 1.2.8 (85.5 KB) 作者: Are Mjaavatten
Calculates the local radius of curvature as well as the cumulative arc length and the curvature vector along a 1D curve in 2D or 3D space
5.1K 次下载
更新时间 2021/11/10

查看许可证

Function circumcenter finds the radius R and the center of the circumscribed circle of a triangle in 3D space.
Function curvature calls circumcenter for every triplet , , of neighboring points along the curve. The curvature is defined as . The curvature vector is , where is the unit vector in the direction from to the center of the circle.
Note that this local calculation is sensitive to noise in the data.
The syntax is:
[L,R,K] = curvature(X)
X: array of column vectors for the curve coordinates. X may have two or three columns.
L: Arc length
R: Curvature radius
K: Curvature vector

引用格式

Are Mjaavatten (2024). Curvature of a 1D curve in a 2D or 3D space (https://www.mathworks.com/matlabcentral/fileexchange/69452-curvature-of-a-1d-curve-in-a-2d-or-3d-space), MATLAB Central File Exchange. 检索来源 .

MATLAB 版本兼容性
创建方式 R2014b
兼容任何版本
平台兼容性
Windows macOS Linux
类别
Help CenterMATLAB Answers 中查找有关 Sparse Matrices 的更多信息

Community Treasure Hunt

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

Start Hunting!
版本 已发布 发行说明
1.2.8

Now gives R = Inf , k = [0;0;0] whenever three consecutive points are in line.
Thanks to Santi Montagud for pointing out this shortcoming.

1.2.7

Bug fix

1.2.6

Inspired by the comment by @Fei Chen I now check if starting and end points are equal. If so, I calculate results for this point as well. In previous versions, starting and end point values were always NaN.

1.2.5

Changed title to make it clearer.

1.2.4

Fixed typos in accompanying note.

1.2.3

Yet another mixup: Correct heading this time

1.2.2

Uploaded wrong file in v. 1.2.1

1.2.1

Corrected minor bug in circumcenter function. It now runs faster for a single output (R) than for more. Results remain unchanged.

1.2.0

The code is simplified and about 30% faster. The derivation of the mathematical model is included as a separate document. The output is identical to version 1.1.

1.1.1

Forgot to update image

1.1.0

The direction of the curvature vector in version 1.0 was very wrong. Corrected in version 1.1

1.0.1

Improved image

1.0.0