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


边栏推荐
- Sorting problem: bubble sort, select sort, insert sort
- RNN recurrent neural network
- Do you think you are a reliable test / development programmer? "Back to the pot"? Surface and reality
- Why the server is stuck
- How does the national standard gb28181 protocol easygbs platform realize device video recording and set streaming IP?
- What are the main reasons for server crash
- 性能测试包括哪些方面?分类及测试方法有哪些?
- 『期末复习』16/32位微处理器(8086)基本寄存器
- 【故障诊断】基于贝叶斯优化支持向量机的轴承故障诊断附matlab代码
- Vim中删除^M
猜你喜欢
随机推荐
Three skills are needed to engage in SAP related work
Can C use reflection to assign values to read-only attributes?
Experimental flags: --disable_ admission_ control=false --enable_ rm=false --llama_ callback_ port=28000
C#使用log4net插件,输出日志到文件
【毕业季_进击的技术er】送别过去两年迷茫的自己。重整旗鼓,大三我来啦
【保姆级】包体积优化教程
Show you the principle of IO multiplexing (select, poll and epoll)
09 eth smart contract
2万字带你从0到1搭建一套企业级微服务安全框架
抖音web端 s_v_web_id 参数生成分析与实现
Do you think you are a reliable test / development programmer? "Back to the pot"? Surface and reality
『HarmonyOS』工程的创建与虚拟机的使用
【C语言】文件操作
vulnhub Lampião: 1
归并排序(merge_sort)
『HarmonyOS』DevEco的下载安装与开发环境搭建
『牛客|每日一题』模板栈
What are the main reasons for server crash
Go 的通道channel
【无标题】


![[untitled]](/img/42/5e8b62edc0aa289098425b26df2453.jpg)






