2D Line Curvature and Normals

版本 1.3.0.0 (9.0 KB) 作者: Dirk-Jan Kroon
Accurate Curvature and Normals of a line/contour consisting of 2D points
11.3K 次下载
更新时间 2011/10/17

查看许可证

编者注: This file was selected as MATLAB Central Pick of the Week

LineCurvature2D, This function calculates the curvature of a 2D line. It first fits polygons to the points. Then calculates the analytical curvature from the polygons.

K = LineCurvature2D(Vertices,Lines)

inputs,
Vertices : A M x 2 list of line points.
(optional)
Lines : A N x 2 list of line pieces, by indices of the vertices
(if not set assume Lines=[1 2; 3 4 ; ... ; M-1 M])

outputs,
K : M x 1 Curvature values

.
.
LineNormals2D, This function calculates the normals, of the line. Using the neighbouring points of each line/contour point, and forward an backward differences on the end points

N=LineNormals2D(V,L)

inputs,
V : List of points/vertices 2 x M
(optional)
Lines : A N x 2 list of line pieces, by indices of the vertices
(if not set assume Lines=[1 2; 3 4 ; ... ; M-1 M])

outputs,
N : The normals of the Vertices 2 x M

引用格式

Dirk-Jan Kroon (2024). 2D Line Curvature and Normals (https://www.mathworks.com/matlabcentral/fileexchange/32696-2d-line-curvature-and-normals), MATLAB Central File Exchange. 检索来源 .

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

启发作品: thick_line(x,y,thickness)

Community Treasure Hunt

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

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

Corrected typo reported by Ravikiran Janardhana

1.0.0.0