资源描述:
《vb平差程序设计复习资料》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、测边交会OptionCompareDatabasePublicDDD_XAsDouble,DDD_YAsDouble'待定点X,Y'已知A、B两点坐标及观测的边长计算待定点坐标,BCJSDDDZB的中文意思是由观测边长计算待定点坐标PublicSubBCJSDDDZB(xaAsDouble,yaAsDouble,xbAsDouble,ybAsDouble,L1AsDouble,L2AsDouble)DimSABAsDouble,LAsDouble,HAsDouble,cosABAsDouble,sinABAsDoubleSAB=Sqr((xb-
2、xa)*(xb-xa)+(yb-ya)*(yb-ya))L=(L1*L1+SAB*SAB-L2*L2)/(2*SAB)H=Sqr(L1*L1-L*L)cosAB=(xb-xa)/SABsinAB=(yb-ya)/SABDDD_X=xa+L*cosAB+H*sinABDDD_Y=ya+L*sinAB-H*cosABEndSubPrivateSubcmd_返回选题界面_Click()DoCmd.OpenForm"选题界面",acNormal,"","",,acNormalDoCmd.CloseacForm,"测边交会"EndSubPrivateSu
3、bcmd_计算_Click()DimxaAsDouble,yaAsDouble,xbAsDouble,ybAsDouble,L1AsDouble,L2AsDoubleIfIsNull(Me.txt_Xa)OrIsNull(Me.txt_Ya)OrIsNull(Me.txt_Xb)OrIsNull(Me.txt_Yb)ThenMsgBox"请输入完整的坐标数据!!!",vbOKCancel+vbInformation,"提示"EndIfIfIsNull(Me.txt_L1)OrIsNull(Me.txt_L2)ThenMsgBox"请输入完整的观
4、测边长数据!!!",vbOKCancel+vbInformation,"提示"EndIfxa=Me.txt_Xa:ya=Me.txt_Yaxb=Me.txt_Xb:yb=Me.txt_YbL1=Me.txt_L1:L2=Me.txt_L2If(xb-xa)=0And(yb-ya)=0ThenMsgBox"您选择的是同一个点!",vbOKOnly+vbExclamation,"提示信息"ElseCallBCJSDDDZB(xa,ya,xb,yb,L1,L2)Me.txt_DX=Format(DDD_X,"0.000")Me.txt_DY=Form
5、at(DDD_Y,"0.000")EndIfEndSubPrivateSubcmd_数据清空_Click()Me.txt_Xa="":Me.txt_Ya=""Me.txt_Xb="":Me.txt_Yb=""Me.txt_L1="":Me.txt_L2=""Me.txt_DX="":Me.txt_DY=""Me.txt_Xa.SetFocusEndSubPrivateSubForm_Load()Me.txt_Xa="":Me.txt_Ya=""Me.txt_Xb="":Me.txt_Yb=""Me.txt_L1="":Me.txt_L2=""M
6、e.txt_DX="":Me.txt_DY=""Me.txt_Xa.SetFocusEndSub测角交会OptionCompareDatabaseConstPI=3.14159265358979PublicDDD_XAsDouble,DDD_YAsDouble'待定点X,Y'角度化弧度PublicFunctionAngleToRadian(ByValalfaAsDouble)AsDoublealfa=alfa+0.00000000000001Dimalfa1AsDouble,alfa2AsDoublealfa1=Fix(alfa)+Fix((a
7、lfa-Fix(alfa))*100#)/60#alfa2=(alfa*100#-Fix(alfa*100#))/36#AngleToRadian=(alfa2+alfa1)*PI/180#EndFunction'已知A、B两点坐标及观测的角度计算待定点坐标,JDJSDDDZB的中文意思是由观测角度计算待定点坐标PublicSubJDJSDDDZB(xaAsDouble,yaAsDouble,xbAsDouble,ybAsDouble,JDAAsDouble,JDBAsDouble)DimtanAAsDouble,tanBAsDoubleJDA
8、=AngleToRadian(JDA)JDB=AngleToRadian(JDB)tanA=Tan(JDA)tanB=Tan(JDB)DDD_X=(x