中國(guó)信鴿協(xié)會(huì)公布GPS空距算法
近日中國(guó)信鴿協(xié)會(huì)公布了GPS空距算法,要求各個(gè)廠家按照此算法計(jì)算空距。這結(jié)束了信鴿競(jìng)翔系統(tǒng)空距計(jì)算的混亂局面,向中國(guó)信鴿競(jìng)翔系統(tǒng)標(biāo)準(zhǔn)的制定邁出了具有歷史意義的一步。GPS算法如下:
(VFox語言編寫)
var
u_x1,u_y1,u_x2,u_y2:string;
u_dxy,u_x,u_y,u_mx1,u_mx2,u_my1,u_my2,tmpany:string;
begin
tmpany:=str((u_x1-int(u_x1))*10000,4);
end;
para u_x1,u_y1,u_x2,u_y2
prive u_dxy,u_x,u_y,u_mx1,u_mx2,u_my1,u_my2,tmpany
if u_x1=0 and u_y1=0
u_xy=0
return u_xy
endif
u_dxy=3.141592654
//地點(diǎn)1
tmpany=str((u_x1-int(u_x1))*10000,4)//經(jīng)度
u_mx1=int(u_x1)+(val(left(tmpany,2))/60)+(val(right(tmpany,2))/3600)
tmpany=str((u_y1-int(u_y1))*10000,4)//緯度
u_my1=int(u_y1)+(val(left(tmpany,2))/60)+(val(right(tmpany,2))/3600)
//地點(diǎn)2
tmpany=str((u_x2-int(u_x2))*1000000,6)
u_mx2=int(u_x2)+(val(left(tmpany,2))/60+(val(substr(tmpany,3,2))/3600+(val(right(tmpany,2))/360000)
tmpany=str((u_y2-int(u_x2))*1000000,6)
u_my2=int(u_y2)+(val(left(tmpany,2))/60+(val(substr(tmpany,3,2))/3600+(val(right(tmpany,2))/360000)
u_x=(round((111.3200144*cos(dtor(u_my1))+111.3200144*cos(dtor(u_my2)))*(u_mx1-u_mx2)/2.7))*2
u_y=(round(110.9481458*(u_my1-u_my2),7))**2
*u_x=((12756.334*u_dxy/360*cos(dtor(u_my1))+12756.334*u_dxy/360*cos(dtor(u_my2)))*(u_mx1-u_mx2)/2)**2
*u_y=(12713.721*u_dxy/360*(u_my1-u_my2))*2
tmpany=round(sqrt(u_x+u_y)*1000,0)
u_xy=iif(tmpany>=9999999,9999999,tmpany)
u_xy=u_xy/1000
replace sv with u_xy
@13.35 say u_xy
return