📄 tofang.m
字号:
% gear
% unit: mm
% press ang: 20deg
clear;
m=2;
z=50;
h=.5;% 1*m
rb=.5*m*z*cos(20*pi/180);
ra=m*(.5*z+h);
N=10;
delr=(ra-rb)/N;
% cal one side
rk=rb:delr:ra;
alphak=acos(rb./rk);
thetak=tan(alphak)-alphak;
% circle
for n=1:361
xc(n)=rb*cos(n*pi/180);
yc(n)=rb*sin(n*pi/180);
end
plot(xc,yc);
hold on;
axis equal
%axis square
% plot one side
n=0;
x=rk.*cos(n*360/z*pi/180+thetak);
y=rk.*sin(n*360/z*pi/180+thetak);
plot(x,y,'r');
% cal ang at contact point of one side
rc=.5*m*z;
alphac=acos(rb/rc);
thetac=tan(alphac)-alphac;
theta_width=2*pi/z/2;
theta_otherside=thetac*2+theta_width;
theta_sym=theta_otherside/2;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -