⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 form1.h

📁 高斯投影计算
💻 H
📖 第 1 页 / 共 2 页
字号:
			// LF
			// 
			this->LF->Location = System::Drawing::Point(133, 212);
			this->LF->Name = L"LF";
			this->LF->Size = System::Drawing::Size(39, 21);
			this->LF->TabIndex = 47;
			this->LF->Text = L"8";
			// 
			// LD
			// 
			this->LD->Location = System::Drawing::Point(70, 212);
			this->LD->Name = L"LD";
			this->LD->Size = System::Drawing::Size(39, 21);
			this->LD->TabIndex = 46;
			this->LD->Text = L"115";
			// 
			// button1
			// 
			this->button1->Location = System::Drawing::Point(291, 156);
			this->button1->Name = L"button1";
			this->button1->Size = System::Drawing::Size(75, 23);
			this->button1->TabIndex = 52;
			this->button1->Text = L"正算->";
			this->button1->Click += gcnew System::EventHandler(this, &Form1::button1_Click);
			// 
			// button2
			// 
			this->button2->Location = System::Drawing::Point(291, 204);
			this->button2->Name = L"button2";
			this->button2->Size = System::Drawing::Size(75, 23);
			this->button2->TabIndex = 53;
			this->button2->Text = L"<-反算";
			this->button2->Click += gcnew System::EventHandler(this, &Form1::button2_Click);
			// 
			// label10
			// 
			this->label10->AutoSize = true;
			this->label10->Font = (gcnew System::Drawing::Font(L"SimSun", 12, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point, 
				static_cast<System::Byte>(134)));
			this->label10->Location = System::Drawing::Point(11, 21);
			this->label10->Name = L"label10";
			this->label10->Size = System::Drawing::Size(125, 16);
			this->label10->TabIndex = 54;
			this->label10->Text = L"请选择分带方式:";
			// 
			// panel2
			// 
			this->panel2->Controls->Add(this->label10);
			this->panel2->Controls->Add(this->radioButton1);
			this->panel2->Controls->Add(this->radioButton2);
			this->panel2->Location = System::Drawing::Point(27, 61);
			this->panel2->Name = L"panel2";
			this->panel2->Size = System::Drawing::Size(220, 63);
			this->panel2->TabIndex = 59;
			// 
			// radioButton3
			// 
			this->radioButton3->AutoSize = true;
			this->radioButton3->Location = System::Drawing::Point(393, 97);
			this->radioButton3->Name = L"radioButton3";
			this->radioButton3->Size = System::Drawing::Size(106, 16);
			this->radioButton3->TabIndex = 56;
			this->radioButton3->TabStop = false;
			this->radioButton3->Text = L"IUGG-1975椭球";
			this->radioButton3->CheckedChanged += gcnew System::EventHandler(this, &Form1::radioButton3_CheckedChanged);
			// 
			// label11
			// 
			this->label11->AutoSize = true;
			this->label11->Font = (gcnew System::Drawing::Font(L"SimSun", 12, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point, 
				static_cast<System::Byte>(134)));
			this->label11->Location = System::Drawing::Point(253, 82);
			this->label11->Name = L"label11";
			this->label11->Size = System::Drawing::Size(133, 16);
			this->label11->TabIndex = 57;
			this->label11->Text = L"请选择椭球参数:";
			// 
			// radioButton4
			// 
			this->radioButton4->AutoSize = true;
			this->radioButton4->CausesValidation = false;
			this->radioButton4->Checked = true;
			this->radioButton4->Location = System::Drawing::Point(393, 70);
			this->radioButton4->Name = L"radioButton4";
			this->radioButton4->Size = System::Drawing::Size(118, 16);
			this->radioButton4->TabIndex = 55;
			this->radioButton4->Text = L"克拉索夫斯基椭球";
			this->radioButton4->CheckedChanged += gcnew System::EventHandler(this, &Form1::radioButton4_CheckedChanged);
			// 
			// Form1
			// 
			this->AutoScaleDimensions = System::Drawing::SizeF(6, 12);
			this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
			this->ClientSize = System::Drawing::Size(616, 322);
			this->Controls->Add(this->label11);
			this->Controls->Add(this->radioButton4);
			this->Controls->Add(this->panel2);
			this->Controls->Add(this->radioButton3);
			this->Controls->Add(this->button2);
			this->Controls->Add(this->button1);
			this->Controls->Add(this->label7);
			this->Controls->Add(this->label8);
			this->Controls->Add(this->label9);
			this->Controls->Add(this->LM);
			this->Controls->Add(this->LF);
			this->Controls->Add(this->LD);
			this->Controls->Add(this->label16);
			this->Controls->Add(this->label17);
			this->Controls->Add(this->label18);
			this->Controls->Add(this->BM);
			this->Controls->Add(this->BF);
			this->Controls->Add(this->BD);
			this->Controls->Add(this->dybox);
			this->Controls->Add(this->label6);
			this->Controls->Add(this->label5);
			this->Controls->Add(this->label4);
			this->Controls->Add(this->ybox);
			this->Controls->Add(this->xbox);
			this->Controls->Add(this->label3);
			this->Controls->Add(this->label2);
			this->Controls->Add(this->label1);
			this->Icon = (cli::safe_cast<System::Drawing::Icon^  >(resources->GetObject(L"$this.Icon")));
			this->Name = L"Form1";
			this->Text = L"高斯平面坐标系与大地坐标系的关系";
			this->Load += gcnew System::EventHandler(this, &Form1::Form1_Load);
			this->panel2->ResumeLayout(false);
			this->panel2->PerformLayout();
			this->ResumeLayout(false);
			this->PerformLayout();

		}
#pragma endregion

	private: System::Void Form1_Load(System::Object^  sender, System::EventArgs^  e) {
				 if(this->radioButton1 ->Checked )
					 ifliu=true;
				 else
					 ifliu=false;

				 if (Form1::radioButton4->Checked )
					 ifke=true;
				 else
					 ifke=false;
				 changeifke();


			 }




	private: System::Void radioButton1_CheckedChanged(System::Object^  sender, System::EventArgs^  e) {
				 if(this->radioButton1 ->Checked )
					 ifliu=true;
				 else
					 ifliu=false;

			 }
	private: System::Void button1_Click(System::Object^  sender, System::EventArgs^  e) {

				 jiaodu ^LJ=gcnew jiaodu(LD,LF,LM);

				 jiaodu ^BJ=gcnew jiaodu(BD,BF,BM);

				 double B,L,X,n,n2,n4,t,t2,t4,m,m2,m4,N,x,y;
			
				 System::String ^ ys;
				 int dai;
				 B=BJ->gethudu();
				 L=LJ->gethudu();


				 if (ifliu)
				 { dai=Math::Floor(L/hudu(6));
				 L-=dai*hudu(6);
				 L-=hudu(3);
				 }
				 else
				 {L-=hudu(1.5);
				 dai=Math::Floor(L/hudu(3));
				 L-=dai*hudu(3);
				 L-=hudu(1.5);
				 }

				 dai+=1;			 
				 qiux ^x1=gcnew qiux(B,ifke);
				 X=x1->answer();

				 n=Math::Pow (e2,0.5)*Math::Cos (B);
				 t=Math::Tan (B);
				 N=a/Math::Sqrt(1-e2*mysin(B,2));

				 m=Math::Cos(B)*L;
				 t2=Math::Pow (t,2);
				 t4=Math::Pow (t,4);
				 m2=Math::Pow (m,2);
				 m4=Math::Pow (m,4);
				 n2=Math::Pow (n,2);
				 n4=Math::Pow (n,4);

				 x=X+N*t*(0.5*m2+1/24*(5-t2+9*n2+4*n4)*m4+1/720*(61-58*t2+t4)*m4*m2);
				 y=N*(m+1/6*(1-t2+n2)*m2*m+1/120*(5-18*t2+t4+14*n2-58*n2*t2)*m4*m);
				 xbox->Text ::set (Convert::ToString (x));
				 ybox->Text ::set (Convert::ToString (y));

				 ys=System::String ::Concat (Convert::ToString (dai)," ",Convert::ToString (y+500000));
				 dybox->Text ::set(ys);


			 }
			 			 

	private: System::Void radioButton4_CheckedChanged(System::Object^  sender, System::EventArgs^  e) {
				 if (Form1::radioButton4->Checked )
				 { ifke=true;
				 Form1::radioButton3 ->Checked =false;}
				 else
					 ifke=false;
				 changeifke();
			 }
	public: System::Void changeifke(){
				//if(ifke)
				//{ e2=0.006693421623;
				//e2p=0.006738525415;
				//a=6378245;}			
				//else
				//{e2=0.00669438500;
				//e2p=0.006739501819;
				//a=6378140;
				//}
				if(ifke)
				{ e2=0.00669342162297;
				e2p=0.00673852541468;
				a=6378245;}			
				else
				{e2=0.00669438499959;
				e2p=0.00673950181947;
				a=6378140;
				}


		 }
	private:double hudu(double d){
						return d*p;}
	private: System::Void button2_Click(System::Object^  sender, System::EventArgs^  e) {
				 double X,y,Y,Bf,vf,nf,tf,Nf,B,L;
		
				 try{
					 X=Convert::ToDouble(xbox->Text);
					 y=Convert::ToDouble (ybox->Text );
					 System::String ^ te;
					 te=dybox->Text ::get();
					 int r;
					 r=te->IndexOf (" ");				 
					 Y=Convert::ToDouble(te->Substring (0,r));
					 if(Convert::ToDouble (te->Substring (r))-(y+500000)>0.1)
					 { MessageBox::Show ("Y的值输入错误!","error!");
					 return;
					 }
				 }

				 catch(...)
				 {MessageBox::Show ("数据格式错误!","error");
				 }

				 Bf=xtob(X);
				 vf=Math::Sqrt(1+e2p*Math::Pow (Math::Cos (Bf),2));
				 nf=Math::Sqrt (e2p)*Math::Cos (Bf);
				 tf=Math::Tan (Bf);
				 Nf=a/Math::Sqrt(1-e2*mysin(B,2));
				 //
				 B=Bf-0.5*Math::Pow (vf,2)*tf*(Math::Pow (y/Nf,2)-1/12*(5+3*Math::Pow (tf,2)+Math::Pow (nf,2)-9*Math::Pow (nf*tf,2))*Math::Pow (y/Nf,4)+1/360*(61+90*Math::Pow (tf,2)+45*Math::Pow (tf,4))*Math::Pow (y/Nf,6));
				 L=1/Math::Cos (Bf)*(y/Nf-1/6*(1+2*Math::Pow(tf,2)+Math::Pow (nf,2))*Math::Pow(y/Nf,3)+1/120*(5+28*Math::Pow (tf,2)+24*Math::Pow(tf,4)+6*Math::Pow(nf,2)-8*Math::Pow(nf*tf,2))*Math::Pow(y/Nf,5));
				 //
				 if(ifliu)
					 L+=((Y-1)*6+3)/180*Math::PI ;
				 else
					 L+=((Y-1)*3+3)/180*Math::PI;
				 //

				 jiaodu ^jb=gcnew jiaodu(B,true);
				 jiaodu ^jl=gcnew jiaodu(L,true);

				 jb->setjiaodu (BD,BF,BM);
				 jl->setjiaodu (LD,LF,LM);



			 }

	private:System::Double xtob(double  X){
				double b,fbf,bf;
				if(ifke)
				{b=X/111134.8611;
				while(true)
				{ bf=b;
				fbf=-(32005.7799*mysin(b*p)+133.9238*mysin(b*p,3)+0.6973*mysin (b*p,5)+0.0039*mysin(b*p,7))*mycos(b*p);
				b=(X-fbf)/111134.8611;
				if(Math::Abs (b-bf)<0.0000000001)
					break;
				}
				return b/180*Math::PI;
				}
				else
				{
				b=X/111134.0047;
				while(true)
				{ bf=b;
				fbf=-(32009.8575*mysin(b*p)+133.9602*mysin(b*p,3)+0.6976*mysin (b*p,5)+0.0039*mysin(b*p,7))*mycos(b*p);
				b=(X-fbf)/111134.0047;
				if(Math::Abs (b-bf)<0.0000000001)
					break;
				}
				return b/180*Math::PI;}


			}
	private:System::Double  mysin(double x,int n)
			{return System::Math ::Pow(System::Math ::Sin (x),n);

			}
	private:System::Double  mysin(double x)
			{return System::Math ::Sin (x);

			}

	private:System::Double  mycos(double x,int n)
			{return System::Math::Pow(System::Math ::Cos (x),n);

			}
	private:System::Double  mycos(double x)
			{return System::Math ::Cos (x);
			}


	private: System::Void radioButton3_CheckedChanged(System::Object^  sender, System::EventArgs^  e) {
				 if (Form1::radioButton3->Checked )
				 { Form1::radioButton4 ->Checked =false;
				 ifke=false;}
				 else
					 ifke=true;
				 changeifke(); }
	private: System::Void panel1_Paint(System::Object^  sender, System::Windows::Forms::PaintEventArgs^  e) {
			 }
	private: System::Void radioButton2_CheckedChanged(System::Object^  sender, System::EventArgs^  e) {
				 if(this->radioButton2 ->Checked )
					 ifliu=false;
				 else
					 ifliu=true;}
	};
}


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -