坐標方位角計算小程序


一名測繪工程專業的在校大學生,利用閑暇時間自學編程,寫了一個測量小程序以供參考

 

程序運行界面:

該程序的理論基礎為數字測圖中的坐標方位角推算公式,利用Windows窗體應用程序技術具體實現,主要程序代碼如下:

 1 1 using System;
 2  2 using System.Collections.Generic;
 3  3 using System.ComponentModel;
 4  4 using System.Data;
 5  5 using System.Drawing;
 6  6 using System.Linq;
 7  7 using System.Text;
 8  8 using System.Threading.Tasks;
 9  9 using System.Windows.Forms; 
10 11 namespace chuangti
11 12 {
12 13     public partial class Form1 : Form
13 14     {
14 15         public Form1()
15 16         {
16 17             InitializeComponent();
17 18         }
18 19         private void button2_Click(object sender, EventArgs e)
19 20         {
20 21             Application.Exit();
21 22         }
22 23         private void button1_Click(object sender, EventArgs e)
23 24         {             
24 25             double yB,yA,xB,xA,d,f;
25 26             double.TryParse(textBox6.Text,out yB);
26 27             double.TryParse(textBox3.Text,out yA);
27 28             double.TryParse(textBox5.Text,out xB);
28 29             double.TryParse(textBox2.Text,out xA);
29 30             //double.TryParse(textBox8.Text,out z);
30 31             d = Math.Atan((yB - yA) / (xB - xA));
31 32             f = Math.Sqrt((xB - xA)* (xB - xA)+ (yB - yA)* (yB - yA));
32 33             //z = d;
33 34             string s = Convert.ToString(d);
34 35             string s1 = Convert.ToString(f);
35 36             textBox7.Text = s;
36 37             textBox8.Text = s1;
37 38 
38 39         }
39 40     }
40 41 }

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM