1 Star 0 Fork 0

Briefly/rldemo_paper_code

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
angledemo2.m 837 Bytes
一键复制 编辑 原始数据 按行查看 历史
Briefly 提交于 2023-09-10 17:56 . 添加所有文件
syms k
t = 0:0.1:2*pi;
r = 2;
res = [];
xpos = [];
rd = 6:1:20;
x = r*cos(t);
y = r*sin(t);
amx = [];
ag = [];
% x采样点
sx = xc+r;
for xc = rd
x1 = r*cos(t)+xc;
y2 = r*sin(t)+yc;
xpos = [];
res = [];
for j = t
xi = r*cos(j);
yi = r*sin(j);
result = solve(abs(k*xc-yc-k*xi+yi)/sqrt(k^2+1)==2);
tmp = real(result);
g = double(tmp(tmp~=0));
grad1 = g(1);
grad2 = g(2);
if abs(grad1) < grad2
g1 = -grad2;
g2 = grad2;
else
g1 = grad1;
g2 = abs(grad1);
end
xpos = [xpos xi];
res = [res abs(atand(g1) - atand(g2))];
end
[~,idx] = max(res);
mx = xpos(idx);
qx = r*2*r/xc;
ag = [ag qx];
amx = [ amx mx];
end
figure()
plot(amx,'or')
hold on
plot(ag)
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/briefly/rldemo_paper_code.git
git@gitee.com:briefly/rldemo_paper_code.git
briefly
rldemo_paper_code
rldemo_paper_code
master

搜索帮助