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
다운로드 수: 5K
업데이트 날짜: 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 (, 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!
버전 게시됨 릴리스 정보

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


Bug fix


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.


Changed title to make it clearer.


Fixed typos in accompanying note.


Yet another mixup: Correct heading this time


Uploaded wrong file in v. 1.2.1


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


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.


Forgot to update image


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


Improved image