91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 171KB
    文件類型: .zip
    金幣: 2
    下載: 2 次
    發(fā)布日期: 2021-05-13
  • 語(yǔ)言: Matlab
  • 標(biāo)簽: 數(shù)控??MATLAB??

資源簡(jiǎn)介

數(shù)控插補(bǔ)源程序代碼以及課設(shè)報(bào)告模板,直線插補(bǔ)和圓弧插補(bǔ)都有,DDA直線插補(bǔ)和逐點(diǎn)比較圓弧插補(bǔ)

資源截圖

代碼片段和文件信息

%?init?part
close?all
clear?all
clc

global?x?y?speed?steplengh;


%初始化參數(shù)------------------------------
clockwise=0;%??1:clockwise?0:?anti-clockwise
speed=0.1;????%speed?of?running插補(bǔ)速度.
xs?=4;??%?x?start?point?x起始點(diǎn)
ys?=-4;??%?y?start?point?y起始點(diǎn)
xe?=4;?%?x?end?point?x終點(diǎn)
ye?=4;?%?y?end?point?y終點(diǎn)
x0=0;%圓心坐標(biāo)
y0=0;%圓心坐標(biāo)
steplengh=0.5;%步長(zhǎng)

%理論曲線繪制-----------------------------
????if?clockwise==1%順時(shí)針理論曲線
????r=sqrt((xe-x0)^2+(ye-y0)^2);%求半徑
????rr=1.5*r;
????axis([0?rr?-rr?rr]);
???jd=atan((ys-y0)/(xs-x0));?
?jd1=atan((ye-y0)/(xe-x0));
?t=jd1:0.001:jd;
??xt?=?r*cos(t)+x0;
yt?=?r*sin(t)+y0;
plot(xtyt‘g‘);
axis(‘equal‘);
grid?on;?%繪制網(wǎng)格
hold?on;
elseif?clockwise==0?%逆時(shí)針
?????r=sqrt((xe-x0)^2+(ye-y0)^2);
????rr=1.5*r;
????axis([0?rr?-rr?rr]);
???jd=atan((ys-y0)/(xs-x0));?
?jd1=atan((ye-y0)/(xe-x0));
?t=jd:0.001:jd1;
??xt?=?r*cos(t)+x0;
yt?=?r*sin(t)+y0;
plot(xtyt‘g‘);
axis(‘equal‘);
grid?on;
hold?on;???
????end?

%?main?part--------------------------------------------
%Go(??)--進(jìn)給函數(shù),每步進(jìn)給繪圖?
???%Go(10)--?x方向正向進(jìn)給一步?
???%Go(01)--?y方向正向進(jìn)給一步
???%Go(-10)--?x方向負(fù)向進(jìn)給一步?
???%Go(0-1)--?y方向負(fù)向進(jìn)給一步
Go(xsys);?%?move?to?start?point.
f=0;??%f--偏差函數(shù)
x=xs;
y=ys;?
if?ys*ye<0
????zero=sqrt(r^2-y0^2)+x0;
????N=abs(xe-zero)+abs(xs-zero)+abs(ye-ys);
else
N=abs(xe-xs)+abs(ye-ys);??%??進(jìn)給步數(shù)
end
?????if?clockwise==1?%順時(shí)針圓弧插補(bǔ)
?????while?(N>0)
?????????if?y>0
?????????if?f?>=?0????%?check?error.
?????????????Go(0-steplengh);????%?x?go????????????
?????????????f?=?f-2*(y-y0)+steplengh;???%?calculate?new?error?f.???
?????????????y?=?y-steplengh;??%?change?x?coordination.?????????
?????????????N=N-steplengh;
?????????else
?????????????Go(steplengh0);????%?y?go
?????????????f?=?f+2*(x-x0)+steplengh;???%?calculate?new?error?f.?????
????????????x?=x+steplengh;??%?change?y?coordination.???????
?????????????N=N-steplengh;
?????????end
?????????elseif?y<=0
??????????????if?f?>=?0????%?check?error.
?????????????Go(-steplengh0);????%?x?go????????????
?????????????f?=?f-2*(x-x0)+steplengh;???%?calculate?new?error?f.???
?????????????x?=?x-steplengh;??%?change?x?coordination.?????????
?????????????N=N-steplengh;
?????????else
?????????????Go(0-steplengh);????%?y?go
?????????????f?=?f-2*(y-y0)+steplengh;???%?calculate?new?error?f.?????
?????????????y?=?y-steplengh;??%?change?y?coordination.???????
?????????????N=N-steplengh;
??????????????end
?????????end???????????
?????end
?????%逆時(shí)針圓弧插補(bǔ)
?????elseif?clockwise==0
?????while?(N>0)
?????????if?y>=0
?????????if?f?>=?0????%?check?error.
?????????????Go(-steplengh0);????%?x?go????????????
?????????????f?=?f-2*(x-x0)+steplengh;???%?calculate?new?error?f.???
?????????????x?=x-steplengh;??%?change?x?coordination.?????????
?????????????N=N-steplengh;
?????????else
?????????????Go(0steplengh);????%?y?go
?????????????f?=?f+2*(y-y0)+steplengh;???%?calculate?new?error?f.?????
????????????y?=y+steplengh;??%?change?y?coordination.???????
??????????

?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????文件??????335797??2018-05-19?00:23??插補(bǔ)源程序\.doc.doc
?????文件????????3724??2018-05-19?00:11??插補(bǔ)源程序\Comparecircle.m
?????文件????????2017??2018-05-18?23:00??插補(bǔ)源程序\DDALINE.m
?????文件????????3469??2018-05-18?23:16??插補(bǔ)源程序\DDAcircle.m
?????文件?????????161??2018-05-15?22:52??插補(bǔ)源程序\Go.m
?????文件???????45436??2018-05-17?04:09??插補(bǔ)源程序\untitled.fig
?????文件???????16315??2018-05-16?20:32??插補(bǔ)源程序\untitled.m
?????目錄???????????0??2018-05-19?00:27??插補(bǔ)源程序\

評(píng)論

共有 條評(píng)論