15
angles1 = [.6111 .6282 1.1517 0.5584 .3141 .7678 .4886 .8027 . 6631 .5587] angles2 = [2.1819 2.1858 2.7093 2.1160 1.8717 2.3254 2.0462 2.3603 2.2207 2.1295] for j=1:10 Counter=0; alpa!one=angles1"j#; alpa!t$o=angles2"j#; %%=4; alpa=0; &&'=1; (('=0; &&=1; ((=0; u=2.)"*"2.+%%,1##; -=2.)"*%%#; ounter= ounter,2; a ' = alpa!one; sgn = 0; 'f alpa!one/p' 2 a '=p'*alpa!one; ounter= ounter,1; sgn=1; en el!alpa=a ' * alpa; ounter= ounter,1; $'le a '*alpa/2.)"*11# ounter= ounter,1; $'le el!alpa/=2.)"*%%# &&'=&&*&&.+u*((.+-; (('=((*((.+u,&&.+-; alpa=alpa,"2.)"*%%##; el!alpa=a '*alpa; ounter= ounter,10; &&=&&'; ((=(('; en %%=%%,1; u=2.)"*"2.+%%,1##;

Dsdb Algorithm

Embed Size (px)

DESCRIPTION

algorithm for testing only

Citation preview

angles1 = [.6111 .6282 1.1517 0.5584 .3141 .7678 .4886 .8027 .6631 .5587]angles2 = [2.1819 2.1858 2.7093 2.1160 1.8717 2.3254 2.0462 2.3603 2.2207 2.1295] for j=1:10Counter=0;alpha_one=angles1(j);alpha_two=angles2(j);kk=4;alpha=0;xxi=1;yyi=0;xx=1;yy=0;u=2.^(-(2.*kk+1));v=2.^(-kk);counter=counter+2;aci = alpha_one;sgn = 0;if alpha_one>pi/2aci=pi-alpha_one;counter=counter+1;sgn=1;enddel_alpha=aci - alpha;counter=counter+1;while aci-alpha>2.^(-11)counter=counter+1;while del_alpha>=2.^(-kk)xxi=xx-xx.*u-yy.*v;yyi=yy-yy.*u+xx.*v;alpha=alpha+(2.^(-kk));del_alpha=aci-alpha;counter=counter+10;xx=xxi;yy=yyi;endkk=kk+1;u=2.^(-(2.*kk+1));v=2.^(-kk);counter=counter+2;endif sgn==0cosalpha_one=xxi;sinalpha_one=yyi;endif sgn==1cosalpha_one=-xxi;sinalpha_one=yyi;endkk=2;alpha=0;xxi=1; yyi=0;xx=1;yy=0;u=2.^(-(2.*kk+1));v=2.^(-kk);counter=counter+2;aci=alpha_two;sgn=0;if alpha_two>pi/2aci=pi-alpha_two;counter=counter+1;sgn=1;enddel_alpha=aci-alpha;counter=counter+1;while aci-alpha>2.^(-11)counter=counter+1;while del_alpha>=2.^(-kk)xxi=xx-xx.*u-yy.*v;yyi=yy-yy.*u+xx.*v;alpha=alpha+(2.^(-kk));del_alpha=aci-alpha;counter=counter+10;xx=xxi;yy=yyi;endkk=kk+1;u=2.^(-(2.*kk+1));v=2.^(-kk);counter=counter+2;endif sgn==0cosalpha_two=xxi;sinalpha_two=yyi;endif sgn==1cosalpha_two=-xxi;sinalpha_two=yyi;endx1=0.5*cosalpha_one;x2=0.5*cosalpha_two;y1=0.5*sinalpha_one;y2=0.5*sinalpha_two; x1i=x1;y1i=y1;x2i=x2;y2i=y2;D=1;teta=pi-alpha_two;counter=counter+1;i=1;flg=0;s=1;minalpha=alpha_one;cos_minalpha=abs(cosalpha_one);sin_minalpha=sinalpha_one;if alpha_one>tetaflg=1;sin_minalpha=sinalpha_two;cos_minalpha=abs(cosalpha_two);enddelta_x=abs(x1i-(0.5-abs(x2i)));counter=counter+1;if delta_x>=0.5s=1;elsefor t=1:12if delta_x-2.^(-t)=2.^(-t)max(t)=1;endendmin=11;if max(1)==1i=1;elsefor t=1:11if max(t)==1 && t < minmin =t;endendi=min;endk=s+i;a1=(2.^(-k))*cosalpha_one;b1=(2.^(-k))*sinalpha_one;a2=(2.^(-k))*cosalpha_two;b2=(2.^(-k))*sinalpha_two;if((x1i-x2i)-D