当前位置:网站首页>曲线曲率展示
曲线曲率展示
2022-07-26 06:41:00 【西木康】
使用
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
子函数
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


边栏推荐
- C#使用log4net插件,输出日志到文件
- The real epidemic situation in the United States, do not easily "bottom" 2020-03-23
- Problems related to the use of ucharts (components) in uniapp
- YOLOv7: Trainable bag-of-freebies sets new state-of-the-art for real-time object detectors
- How to solve the crash when the easygbs platform edits the device management group?
- [pytorch] picture enlargement
- C language file operation
- Go 的切片与数组
- Gdown Access denied:Cannot retrieve the public link of the file.
- [fault diagnosis] bearing fault diagnosis based on Bayesian optimization support vector machine with matlab code
猜你喜欢

Sorting problem: bubble sort, select sort, insert sort

Conda 虚拟环境envs目录为空
![[image hiding] digital image watermarking method technology based on hybrid dwt-hd-svd with matlab code](/img/2a/b5214e9fa206f1872293c9b9d7bdb6.png)
[image hiding] digital image watermarking method technology based on hybrid dwt-hd-svd with matlab code
![[1]数学建模基础入门知识](/img/29/90b1c7533e9443852758d10080e239.png)
[1]数学建模基础入门知识

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

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

YOLOv7: Trainable bag-of-freebies sets new state-of-the-art for real-time object detectors

TCP protocol -- message format, connection establishment, reliable transmission, congestion control

带你搞透IO多路复用原理(select、poll和epoll)

09 eth smart contract
随机推荐
深度学习——CV、CNN、RNN
Map collection inheritance structure
Liberg avenue to Jane series
C语言进阶——可存档通讯录(文件)
[pytorch] CNN practice - flower species identification
SQL optimization scheme
nuxt 配置主题切换
PG Vacuum 杂谈之 auto vacuum
vulnhub Lampião: 1
C language introduction practice (7): switch case calculation of days in the year (normal year / leap year calculation)
【Web3 系列开发教程——创建你的第一个 NFT(4)】NFTs 可以给你带来什么
Go的map字典及约束
PG vacuum auto vacuum
『牛客|每日一题』模板栈
English sentence pattern reference exclusive Edition - adverbial clause
Conda 虚拟环境envs目录为空
Which "digital currencies" can survive this winter? 2020-03-30
定义方法时为什么使用static关键字
将金额数字转换为大写
What are the aspects of performance testing? What are the classification and testing methods?