xxxx18一60岁hd中国/日韩女同互慰一区二区/西西人体扒开双腿无遮挡/日韩欧美黄色一级片 - 色护士精品影院www

  • 大小: 171KB
    文件類型: .zip
    金幣: 2
    下載: 2 次
    發布日期: 2021-05-13
  • 語言: Matlab
  • 標簽: 數控??MATLAB??

資源簡介

數控插補源程序代碼以及課設報告模板,直線插補和圓弧插補都有,DDA直線插補和逐點比較圓弧插補

資源截圖

代碼片段和文件信息

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

global?x?y?speed?steplengh;


%初始化參數------------------------------
clockwise=0;%??1:clockwise?0:?anti-clockwise
speed=0.1;????%speed?of?running插補速度.
xs?=4;??%?x?start?point?x起始點
ys?=-4;??%?y?start?point?y起始點
xe?=4;?%?x?end?point?x終點
ye?=4;?%?y?end?point?y終點
x0=0;%圓心坐標
y0=0;%圓心坐標
steplengh=0.5;%步長

%理論曲線繪制-----------------------------
????if?clockwise==1%順時針理論曲線
????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;?%繪制網格
hold?on;
elseif?clockwise==0?%逆時針
?????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(??)--進給函數,每步進給繪圖?
???%Go(10)--?x方向正向進給一步?
???%Go(01)--?y方向正向進給一步
???%Go(-10)--?x方向負向進給一步?
???%Go(0-1)--?y方向負向進給一步
Go(xsys);?%?move?to?start?point.
f=0;??%f--偏差函數
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);??%??進給步數
end
?????if?clockwise==1?%順時針圓弧插補
?????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
?????%逆時針圓弧插補
?????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.???????
??????????

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

評論

共有 條評論