c语言测绘,测绘常用程序c语言

62e50291a81fc54b507f33cb80033297.gif 测绘常用程序c语言

(11页)

34baf8c720f2918d7892329f7a1dc69d.gif

本资源提供全文预览,点击全文预览即可全文预览,如果喜欢文档就下载吧,查找使用更方便哦!

19.90 积分

- 1 - 测量平差程序设计测量平差程序设计 1.角度(度分秒)到弧度 AngleToRadian #define PI 3.14159265 double AngleToRadian(double angle) { int D,M; double S,radian,degree, angle,MS; D=int(angle+0.3) ; MS=angle-D; M=int((MS)*100+0.3) ; S=(MS*100-M)*100; degree=D+M/60.0+S/3600.0; radian=degree*PI/180.0; return radian; } 注意:防止数据溢出,要加个微小量,例如 0.3. 2.弧度换角度(度分秒) RadianToAngle #define PI 3.14159265 double RadianToAngle(double radian) { int D,M; double S,radian,degree,MS,angle; degree=radian*180/PI; D=int(degree); MS=degree-D; M=int(MS*60); S=(MS*60-M)*60; angle=D+M/100.0+S/10000.0; return angle; } 3.已知两点求坐标方位角 Azimuth #include double Azimuth(double xi,double yi,double xj,double yj) { double Dx,Dy,S,T; Dx=xj-xi; Dy=yj-yi; S=sqrt(Dx*Dx+Dy*Dy); if(S0\ for(i=0;i void countermatrix(double **T, double **s, double **r, double **Q,double **N, double **rt,int n) { for(i=0;i=0;i++) { r[i][i]=1/T[i][i]; for(j=i+1;j0) pPoint=(POINT*)malloc(nDirect*sizeof(POINT)); if(nDirect0) pDirect=(READVALUE*)malloc(nDirect*sizeof(READVALUE)); if(nDistance0) pDistance=(READVALUE*)malloc(nDistance*sizeof(RAADVALUE)); fscanf(fp,”%lf,%lf,%lf\n”, for(i=0;i int checkangle(double angle) { int M,S; double MS; if(angle=0 pStation[nCount].end=p(pDirect[nCount].end; pStation[nCount].value=p(pDirect[nCount].value; nCount++; } return nCount; } 坐标概算全方向法子程序实现流程(coordinate) coordinate (入口参数设置) { READVALUE pStation[50],pObject[50]; int nCount,i,j,k,m,n,p,nobject; for(i=0;i1)||( nCount=1)) { for(j=0;jtype==1) { for(k=0;ktype==0) nobject=GetAllDirect(pStation[j].end- name,nDirect,pDirect,pobject) m=-1; n=-1; for(p=0;pname,pPoint[i].name)==0) { m=p; } - 8 - if(strcmp(pobject[p].end-name,pStation[k].end-name)==0) { n=p; } if(m=0 pStation[j].end=pObject[m].value-pObject[n].value; { Xe=pPoint[i].x; Ye=pPoint[i].y; Xf=pStation[j].end-x; Yf=pStation[j].end-y; Lef=pStation[j].value; Leg=pStation[k].value; Lfe=pObject[m].value; Lfg=pObject[n].value; Qianfang(Xe,Xf,Ye,Yf,Lef,Leg,Lfe,Lfg,*Xg,*Yg;) pStation[k].end-x=*xg; pStation[k].end-y=*yg; pStation[k].end.type=2; } } } } } } } } 13.坐标增量法(calcoordinate) 子函数由端点名称得边长值的函数 GetDistance double GetDistance(char *begin,char *end,int nDistance,READVALUE *pDistance) { int i; for(i=0;iname,begin)==0 } return -1; } /***函数取出观测方向 GetAllDirect***/ - 9 - void calcoordinate(int nDirect,READVALUE *pDirect,int nDistace,READVALUE *pDistance,int nPoint,POINT *pPoint) { int nPoint,nCount,nDirect,nDistance; int m=-1,i,j,k; double x1,y1,x2,y2,A0,A,S,dx,dy; READVALUE*pDirect=NULL; READVALUE pStation[50]; for(i=0;i0) { nCount=GetAllDirect(pPoint[i].name,nDirect,pDirect,pStation[50]); for(j=0;jtype0)m=j; if(m!=-1) { for(k=0;ktype==0) { x1=pPoint[i].x; y1=pPoint[i].y; x2=pStation[j].end-x; y2=pStation[j].end-y; A0=Bearing(x1,y1,x2,y2); A=A0-(DMSToRAD(pStation[m].value)-DMSToRAD(pStation[k].value)); if(A2*PI)A=A-2*PI; S=GetDistance(pPoint[i],pStation[k].end,nDistance,pDistance); if(Sx=pPoint[i].x+dx; pStation[k].end-y=pPoint[i].y+dy; pStation[k].end-type=2;} } } } } } - 10 - } } 14.高斯正反算 高斯正算: #include #include #define PI 3.14159265 double DMSToRAD(double dDMS) { int L1,L2; double T,L3; L1=(int)(dDMS+0.3) ; L2=(int)((dDMS-L1)*100+0.3); L3=((dDMS-L1)*100-L2)*100; T=(L1+L2/60.0+L3/3600.0)*PI/180.0; return T; } void PreGausePositive(double B,double L,double L0, double a, double b, double *N, double *l, double *c, double *t, double *X,double *B1) { double a0,a2,a4,a6,a8,m0,m2,m4,m6,m8; double e,e1; e=(sqrt(a*a-b*b))/a; e1=(sqrt(a*a-b*b))/b; B1=DMSToRAD(B); t=tanB1; c=sqrt(e1*e1*cosB1*cos*B1); l=L-L0; N=a/(sqrt(1-e*e*sinB1*sinB1)); m0=a*(1-e*e); m2=3/2*e*e*m0; m4=5/4*e*e*m2; m6=7/6*e*e*m4; m8=9/8*e*e*m6; a0=m0+m2/2+3*m4/8+5*m6/16+35*m8/128; a2=m2/2+m4/2+15*m6/32+7/16*m8; a4=m4/8+3*m6/16+7*m8/32; a6=m6/32+m8/16; a8=m8/128; X=a0*B1-a2*(sin(2*B1))/2+a4*(sin(4*B1))/4-a6*(sin(6*B1))/6+a8*(sin(8*B1))/8; } Void BLToXY(double *x,double *y,double N,double l,double c,double t,double B1,double X) { x=X+N*l*l*t*cosB1*cosB1*((3+l*l*cosB1*cosB1*(5-t*t+9*c*c+4*c*c*c*c)/4+l*l*\ - 11 - cosB1*cosB1*(61-58*t*t+t*t*t*t)/30))/6; y=N*l*cosB1(1+l*l*cosB1*((1+c*c-t*t)+l*l*cosB1*cosB1(5-18*t*t+t*t*t*t+14*c*c\ -58*t*t*c*c))); } 高斯反算 void XYToBL(double x,double y,double L0,double a,double b,double q,double *B,\ double *L) { double Bf,c,t,y,N,e1,e e=(sqrt(a*a-b*b))/(a*a); e1=(sqrt(a*a-b*b))/(b*b); for(Bf=0;;) { t=tanBf; c=e1*e1*cosBf; N=a/(sqrt(1-e*e*sinBf*sinBf)); B=Bf-(1+c*c)*t*y*y/(2*N*N)*(1-y*y)/(12*N*N)*(15+3*t*t+c*c-9*t*t*c*c)- y*y/(30*N*N)*(61+90*t*t+45*t*t*t*t); if(fabs(B-Bf)q) break; Bf=B; } L=L0+y/(N*cosBf)*(1-y*y/(6*N*N))*((1+2*t*t+c*c)- y*y/(20*N*N)*(5+6*c*c)+28*t*t+24*t*t*t*t+8*t*t*c*c)- y*y/(42*N*N)*(61+662*t*t+1320*t*t*t*t+720*t*t*t*t*t*t)); B=RADToDMS(B); L=RADToDMS(L); } 关 键 词: 测绘 常用 程序 语言

524d6daf746efaa52c3c71bbfe7ba172.gif  天天文库所有资源均是用户自行上传分享,仅供网友学习交流,未经上传用户书面授权,请勿作他用。

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值