当前位置:网站首页>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


边栏推荐
- What is KVM? What is KVM virtual machine?
- C language introduction practice (7): switch case calculation of days in the year (normal year / leap year calculation)
- UIToolkit工具模板工程
- Why use the static keyword when defining methods
- Map collection inheritance structure
- @ConstructorProperties注解理解以及其对应使用方式
- C language file operation
- Facing the rebound market, how do we operate? 2020-03-21
- Regular expressions and calling related functions in C language
- [Web3 series development tutorial - create your first NFT (4)] what can NFTs bring to you
猜你喜欢
![[pytorch] fine tuning technology](/img/d3/6d0f60fffd815f520f4b3880bd0ac7.png)
[pytorch] fine tuning technology

The creation of "harmonyos" project and the use of virtual machines

【C语言】文件操作

PG vacuum auto vacuum

How does the national standard gb28181 protocol easygbs platform realize device video recording and set streaming IP?

Conda 虚拟环境envs目录为空

Overview of image classification of vision transformer must read series

BPG notes (IV)

【图像去噪】基于双立方插值和稀疏表示实现图像去噪matlab源码

Map collection inheritance structure
随机推荐
Click "Niuke | daily question" to eliminate it
Valid bracket sequence of "Niuke | daily question"
Multi target detection
CONDA virtual environment envs directory is empty
[1] Basic knowledge of mathematical modeling
openssl: error while loading shared libraries: libssl.so.1.1
Address resolution ARP Protocol
带你搞透IO多路复用原理(select、poll和epoll)
Liberg avenue to Jane series
Rust语言- Slice(切片)类型(&[u8])
排序问题:冒泡排序,选择排序,插入排序
性能测试包括哪些方面?分类及测试方法有哪些?
抖音web端 s_v_web_id 参数生成分析与实现
Proxyman, a native high-performance packet capturing tool, is for you who love learning
[C language] address book dynamic version and document version
Advanced C language - archived address book (file)
Quick sort
【图像去噪】基于双立方插值和稀疏表示实现图像去噪matlab源码
"Final review" 16/32-bit microprocessor (8086) basic register
[1]数学建模基础入门知识