C++面向对象程序附合导线、解析交会、角度转换类及计算源代码

合集下载
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

#include"stdafx.h"

#include

#include

#include

#include"DegSwitch.h"

#include"Coordinate.h"

#include"LineCalculation.h"

using namespace std;

const int N=50;

void main()

{int degree(int a);

int coordinate(int b);

int linecalculation(int c);

char MODE;

cout<<"D.角度转换C.解析交会L.附合导线"<>MODE;

cout<

int a;

switch(MODE)

{case'D':

a=degree(0);break;

case'C':

a=coordinate(0);break;

case'L':

a=linecalculation(0);break;

}

}

// 附合导线验算函数

int linecalculation(int c)

{

static int A[N][3],AA[3],CAng[N][3];

static double ang[N],cang[N],cang2[N],C[N][2],S[N],Ccoo[N][2],dxdy[N][2];

double x1,y1,s=0,x=0,y=0,dx,dy,sc_ang,ec_ang;

int b=-1,i=0,j=0,n=0,d,m,s0,f_a;

char ch1;

FILE *fp;

fp=fopen("E:\\Mine\\learning\\测量程序设计\\M.txt","r");

if(!fp) printf("文件打开失败");;

for(i=0;i<3;i++)

fscanf(fp,"%d",&AA[i]);

fscanf(fp,"%lf %lf",&x1,&y1);

for(i=0;i

for(j=0;j<3;j++)

fscanf(fp,"%d",&A[i][j]);

fscanf(fp,"%c",&ch1);

for(i=0;i

fscanf(fp,"%lf",&S[i]);

fclose(fp);

DegSwitch *e0=new DegSwitch();

sc_ang=e0->DMS_s(AA[0],AA[1],AA[2]);

LineCalculation *e=new LineCalculation();

e->Start(&n,A,ang,S,&s,&x,&y);

e->Angle_M(ang,n,b,&f_a,&d,&m,&s0);

e->Angle_A(ang,n,b,f_a,S);

e->C_Angle(ang,cang,n,b,sc_ang);

DegSwitch *q=new DegSwitch;

for(i=0;i

cang2[i]=q->DMS_Rad(0,0,cang[i]);

e->Coordinate_M(Ccoo,S,sc_ang,cang,n,x,y,&dx,&dy);

e->Coordinate_A(Ccoo,dxdy,n,dx,dy,S,s);

e->Coordinate(C,Ccoo,n,x1,y1);

cout<

DegSwitch *u=new DegSwitch;

for(i=0;i

{u->s_DMS(ang[i],&A[i][0],&A[i][1],&A[i][2]);

cout<

}

cout<

for(i=0;i

{u->s_DMS(cang[i],&CAng[i][0],&CAng[i][1],&CAng[i][2]);

cout<

cout<

for(i=0;i

cout<

cout<

/*fp=fopen("e:\\mine\\learning\\测量程序设计\\M2.txt","w");

if(!fp) printf("文件创建失败");

fprintf(fp,"%s","调整后角度值:\n");

for(i=0;i

{for(j=0;j<3;j++)

fprintf(fp,"%d ",A[i][j]);

fprintf(fp,"%s"," \n");

}

fprintf(fp,"%s","坐标方位角:\n");

for(i=0;i

{for(j=0;j<3;j++)

fprintf(fp,"%d ",CAng[i][j]);

fprintf(fp,"%s"," \n");

}

fprintf(fp,"%s","坐标:\n");

for(i=0;i

{for(j=0;j<2;j++)

fprintf(fp,"%lf ",C[i][j]);

fprintf(fp,"%s"," \n");

相关文档
最新文档