当前位置:网站首页>Curve curvature display
Curve curvature display
2022-07-26 06:42:00 【Ximukang】
Use
load matlab
x = locusx(1:5:end)';
y = locusy(1:5:end)';
[u,v] = PJ(x,y);
figure(1)
quiver(x(2:end-1),y(2:end-1),u,v,1)
hold on
plot(x,y)
axis equal
Subfunctions
function [kappa,norm_k] = PJcurvature(x,y)
x = reshape(x,3,1);
y = reshape(y,3,1);
t_a = norm([x(2)-x(1),y(2)-y(1)]);
t_b = norm([x(3)-x(2),y(3)-y(2)]);
M =[[1, -t_a, t_a^2];
[1, 0, 0 ];
[1, t_b, t_b^2]];
a = M\x;
b = M\y;
kappa = 2.*(a(3)*b(2)-b(3)*a(2)) / (a(2)^2.+b(2)^2.)^(1.5);
norm_k = [b(2),-a(2)]/sqrt(a(2)^2.+b(2)^2.);
end
function [u,v] = PJ(x,y)
kappa_arr = zeros(length(x)-2,1);
norm_arr = zeros(length(x)-2,2);
for i=2:(length(x)-1)
[kappa,norm_l] = PJcurvature(x(i-1:i+1),y(i-1:i+1));
kappa_arr(i-1) = kappa;
norm_arr(i-1,:) = norm_l;
end
u = kappa_arr.* norm_arr(:,1);
v = kappa_arr.* norm_arr(:,2);
end


边栏推荐
- Tiktok web s_ v_ web_ Analysis and implementation of ID parameter generation
- Markdown add Emoji expression
- 数据库中varchar和Nvarchar区别与联系
- Display Chinese characters in uitoolkit
- [pytorch] CNN practice - flower species identification
- MySQL基础篇(二)-- MySQL 基础
- "Niuke | daily question" inverse Polish expression
- C language introduction practice (7): switch case calculation of days in the year (normal year / leap year calculation)
- CS5801_HDMI转EDP优势替代LT6711A方案
- 力扣——3. 无重复字符的最长子串
猜你喜欢

快速排序(quick-sort)

Vision Transformer 必读系列之图像分类综述

Design principle of infrared circuit of single chip microcomputer

Address resolution ARP Protocol

Conda 虚拟环境envs目录为空

白盒测试的概念、目的是什么?及主要方法有哪些?
![[nanny level] package volume optimization tutorial](/img/45/4ca66b10bb96efeb47501c07972d66.png)
[nanny level] package volume optimization tutorial

『牛客|每日一题』有效括号序列

How to solve the crash when the easygbs platform edits the device management group?

Why the server is stuck
随机推荐
『HarmonyOS』工程的创建与虚拟机的使用
MySQL optimized index and index invalidation
[image hiding] digital image watermarking method technology based on hybrid dwt-hd-svd with matlab code
力扣——3. 无重复字符的最长子串
供应链的多目标协同决策
【图像去噪】基于双立方插值和稀疏表示实现图像去噪matlab源码
"Niuke | daily question" inverse Polish expression
"Niuke | daily question" template stack
[C language] address book dynamic version and document version
『牛客|每日一题』逆波兰表达式
『牛客|每日一题』点击消除
IP day 10 notes - BGP
How to solve the crash when the easygbs platform edits the device management group?
Can C use reflection to assign values to read-only attributes?
A tool for quickly switching local host files -- switchhosts
数据库中varchar和Nvarchar区别与联系
[fault diagnosis] bearing fault diagnosis based on Bayesian optimization support vector machine with matlab code
将一个正整数分解质因数,要求分解成尽可能小的多个的因数。
【故障诊断】基于贝叶斯优化支持向量机的轴承故障诊断附matlab代码
『牛客|每日一题』 栈的压入、弹出序列