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


边栏推荐
- Gdown Access denied:Cannot retrieve the public link of the file.
- Vision Transformer 必读系列之图像分类综述
- Children's programming electronic society graphical programming level examination scratch level 1 real problem analysis (multiple choice) June 2022
- 『牛客|每日一题』 栈的压入、弹出序列
- Input the records of 5 students (each record includes student number and grade), form a record array, and then output them in order of grade from high to low The sorting method adopts selective sortin
- 将一个正整数分解质因数,要求分解成尽可能小的多个的因数。
- Design principle of infrared circuit of single chip microcomputer
- MySQL基础篇(二)-- MySQL 基础
- Advanced C language - archived address book (file)
- Basis of multimodal semantic segmentation
猜你喜欢

CS5801_ HDMI to EDP advantage replaces lt6711a solution
![[pytorch] fine tuning technology](/img/d3/6d0f60fffd815f520f4b3880bd0ac7.png)
[pytorch] fine tuning technology

『HarmonyOS』DevEco的下载安装与开发环境搭建

@ConstructorProperties注解理解以及其对应使用方式

What are the aspects of performance testing? What are the classification and testing methods?

Address resolution ARP Protocol

C# 可以利用反射给只读属性赋值吗?

力扣5: 最长回文子串

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

力扣——3. 无重复字符的最长子串
随机推荐
Valid bracket sequence of "Niuke | daily question"
Three skills are needed to engage in SAP related work
The creation of "harmonyos" project and the use of virtual machines
将一个正整数分解质因数,要求分解成尽可能小的多个的因数。
FastDFS-支持双IP、IPV6
[C language] file operation
dev treelist 常用用法小结
『牛客|每日一题』模板栈
BPG笔记(四)
Upgrade appium automation framework to the latest 2.0
What is the concept and purpose of white box testing? And what are the main methods?
Do it yourself smart home: intelligent air conditioning control
TCP protocol -- message format, connection establishment, reliable transmission, congestion control
09 eth smart contract
Map collection inheritance structure
UIToolkit中显示汉字
Design principle of infrared circuit of single chip microcomputer
C# 可以利用反射给只读属性赋值吗?
『牛客|每日一题』有效括号序列
Convert amount figures to uppercase