当前位置:网站首页>曲线曲率展示
曲线曲率展示
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


边栏推荐
- Decomposing a positive integer into prime factors requires decomposing into as many factors as possible.
- 【图像去噪】基于双立方插值和稀疏表示实现图像去噪matlab源码
- 『HarmonyOS』DevEco的下载安装与开发环境搭建
- [Hangzhou][15k-20k] medical diagnosis company recruits golang development engineers without overtime! No overtime! No overtime!
- 28. Implement strStr()实现 strStr()
- Why the server is stuck
- UIToolkit工具模板工程
- Three skills are needed to engage in SAP related work
- 供应链的多目标协同决策
- Facing the rebound market, how do we operate? 2020-03-21
猜你喜欢

原生高性能抓包工具Proxyman,送给爱学习的你

Map collection inheritance structure

Find the original root

Heap sort

2万字带你从0到1搭建一套企业级微服务安全框架
![[graduation season _ advanced technology Er] farewell to yourself who has been confused for the past two years. Regroup, junior I'm coming](/img/04/3121514fcd8fcf1c939cbca7f4c67a.jpg)
[graduation season _ advanced technology Er] farewell to yourself who has been confused for the past two years. Regroup, junior I'm coming

日志轮转logrotate

堆排序(heap-sort)

09 eth smart contract

带你搞透IO多路复用原理(select、poll和epoll)
随机推荐
BigDecimal变为负数
PG Vacuum 杂谈之 auto vacuum
nuxt 配置主题切换
shell编程
@ConstructorProperties注解理解以及其对应使用方式
Slice and array of go
Design principle of infrared circuit of single chip microcomputer
深度学习——CV、CNN、RNN
YOLOv7: Trainable bag-of-freebies sets new state-of-the-art for real-time object detectors
[Hangzhou][15k-20k] medical diagnosis company recruits golang development engineers without overtime! No overtime! No overtime!
使用Scanner从键盘获取多种数据类型
打开服务器上的 IncludeExceptionDetailInFaults (从 ServiceBehaviorAttribute 或从 <serviceDebug> 配置行为)以便将异常信息发送回
力扣——3. 无重复字符的最长子串
"Harmonyos" explore harmonyos applications
Basis of multimodal semantic segmentation
C language introduction practice (7): switch case calculation of days in the year (normal year / leap year calculation)
RNN recurrent neural network
『牛客|每日一题』逆波兰表达式
MySQL optimized index and index invalidation
What are the aspects of performance testing? What are the classification and testing methods?