導線網平差程序源代碼_第1頁
導線網平差程序源代碼_第2頁
導線網平差程序源代碼_第3頁
導線網平差程序源代碼_第4頁
導線網平差程序源代碼_第5頁
已閱讀5頁,還剩41頁未讀, 繼續(xù)免費閱讀

下載本文檔

版權說明:本文檔由用戶提供并上傳,收益歸屬內容提供方,若內容存在侵權,請進行舉報或認領

文檔簡介

1、精選優(yōu)質文檔-傾情為你奉上精選優(yōu)質文檔-傾情為你奉上專心-專注-專業(yè)專心-專注-專業(yè)精選優(yōu)質文檔-傾情為你奉上專心-專注-專業(yè)程序源代碼C語言程序:#include #include #include #include #include#define PI 3.98#define p .#define MAX 50/矩陣的乘法運算 MatrixMutiply(double Matrix1MAXMAX,double Matrix2MAXMAX,double MatrixResultMAXMAX,int m1,int m2,int m3)int i,j,k;double Sum;for(i=0;i

2、m1;i+) for(j=0;jm3;j+) /*按照矩陣乘法的規(guī)則計算結果矩陣的i*j元素*/ Sum=0; for(k=0;km2;k+) Sum+=Matrix1ik*Matrix2kj; MatrixResultij=Sum; /return MatrixResult;/矩陣的轉置運算 MatrixT(double Matrix1MAXMAX,double TMAXMAX,int m1,int m2) /m1,m2分別是矩陣的行列數(shù) int i,j;/double T5050; for(i=0;im1;i+) for(j=0;jm2;j+) Tji=Matrix1ij; /return

3、 T;/矩陣的逆運算void swap(double a,double b)double c=a;a=b;b=c;double DinV(double A5050,int n) /n代表階數(shù) int i,j,k; double d; int JS50,IS50; for (k=0;kn;k+) d=0; for (i=k;in;i+) for (j=k;jd) d=fabs(Aij); ISk=i; JSk=j; if (d+1.0=1.0) return 0; if (ISk!=k) for (j=0;jn;j+) swap(Akj,AISkj); if (JSk!=k) for (i=0;

4、in;i+) swap(Aik,AiJSk); Akk=1/Akk; for (j=0;jn;j+) if (j!=k) Akj=Akj*Akk; for (i=0;in;i+) if (i!=k) for (j=0;jn;j+) if (j!=k) Aij=Aij-Aik*Akj; for (i=0;i=0;k-) for (j=0;jn;j+) if (JSk!=k) swap(Akj,AJSkj); for (i=0;i=i) break; Xo0=5000.0;Yo0=5000.0; Xo15=5000.0;Yo15=5000.0;so0=s0; /用來求未知點坐標近似值for(i=1

5、;i=(2*PI)alfi=alfi-2*PI;Xoi=Xoi-1+si-1*cos(alfi-1);Yoi=Yoi-1+si-1*sin(alfi-1);/printf(X=%ft,Xoi);for(i=1;i0&(Xoi+1-Xoi)0)/第一象限 alfoi=atan(Yoi+1-Yoi)/(Xoi+1-Xoi);else if(Yoi+1-Yoi)0&(Xoi+1-Xoi)0)/第二象限 alfoi=atan(Yoi+1-Yoi)/(Xoi+1-Xoi)+PI;else if(Yoi+1-Yoi)0)/第三象限 alfoi=atan(Yoi+1-Yoi)/(Xoi+1-Xoi)+2*P

6、I;else /(Yoi-Yoi-1)0&(Xoi-Xoi-1)0)/第四象限 alfoi=atan(Yoi+1-Yoi)/(Xoi+1-Xoi)+PI;/printf(alf=%ft,alfoi);/printf(so=%ft,soi);/求B矩陣/將第一個角度的系數(shù)單獨算出j=0;/B0j=0.0;(Yo14-Yo0)/(so14*so14)*p/1000.0;/B0j+1=0.0;-1*(Xo14-Xo0)/(so14*so14)*p/1000.0;B0j=-1*(Yo1-Yo0)/(so0*so0)*p/1000.0;/B0j+1=(Xo1-Xo0)/(so0*so0)*p/1000.

7、0;B026=(Yo14-Yo0)/(so14*so14)*p/1000.0;B027=-1*(Xo14-Xo0)/(so14*so14)*p/1000.0;/將第二個角度的系數(shù)單獨算出B1j=(Yo2-Yo1)/(so1*so1)-(Yo0-Yo1)/(so0*so0)*p/1000.0;/B1j+1=-1*(Xo2-Xo1)/(so1*so1)-(Xo0-Xo1)/(so0*so0)*p/1000.0;B1j+2=-1*(Yo2-Yo1)/(so1*so1)*p/1000.0;B1j+3=(Xo2-Xo1)/(so1*so1)*p/1000.0;/求其他角度改正的系數(shù) for(i=2;i1

8、5;i+)if(i14)Bij=(Yoi-1-Yoi)/(soi-1*soi-1)*p/1000.0;Bij+1=-1*(Xoi-1-Xoi)/(soi-1*soi-1)*p/1000.0;Bij+2=(Yoi+1-Yoi)/(soi*soi)-(Yoi-1-Yoi)/(soi-1*soi-1)*p/1000.0;Bij+3=-1*(Xoi+1-Xoi)/(soi*soi)-(Xoi-1-Xoi)/(soi-1*soi-1)*p/1000.0;Bij+4=-1*(Yoi+1-Yoi)/(soi*soi)*p/1000.0;Bij+5=(Xoi+1-Xoi)/(soi*soi)*p/1000.0

9、;elseBij=(Yoi-1-Yoi)/(soi-1*soi-1)*p/1000.0;Bij+1=-1*(Xoi-1-Xoi)/(soi-1*soi-1)*p/1000.0;Bij+2=(Yoi+1-Yoi)/(soi*soi)-(Yoi-1-Yoi)/(soi-1*soi-1)*p/1000.0;Bij+3=-1*(Xoi+1-Xoi)/(soi*soi)-(Xoi-1-Xoi)/(soi-1*soi-1)*p/1000.0;j=j+2;B21=0.0;/求邊長改正的系數(shù) j=0;/將第一個邊長的系數(shù)單獨算出Bij=(Xo1-Xo0)/so0; /Bij+1=(Yo1-Yo0)/so0;

10、/(Yo1-Yo0)/(so0*so0);i=i+1; for(i;i30;i+)if(i29)Bij=-1*(Xoi-14-Xoi-15)/soi-15;Bij+1=-1*(Yoi-14-Yoi-15)/soi-15;Bij+2=-1*Bij;Bij+3=-1*Bij+1; elseBij=-1*(Xoi-14-Xoi-15)/soi-15;Bij+1=-1*(Yoi-14-Yoi-15)/soi-15; j=j+2; B161=0.0;for(j=1;j27;j+)for(i=0;i30;i+)Bij=Bij+1;/求L矩陣 L00=(beta0-(alfo0-alfo14+PI)*p;f

11、or(i=1;i30;i+)if(iPI*p)Li0=(Li0-2*PI*p); Li0=Li0; elseLi0=(si-15-soi-15)*1000.0; /求權陣P for(i=0;i30;i+)if(i15)Pii=1;elsesigma_s=5+10*0.*si-15*1000; /單位為(/mm)的平方 Pii=sigma_beta*sigma_beta/(sigma_s*sigma_s); double Tb5050,Tc5050,MatrixResult5050,TV5050;double temp1MAXMAX,temp2MAXMAX,temp3MAXMAX,temp4MA

12、XMAX,temp5MAXMAX; /計算Nbb矩陣,W矩陣 m1=30;m2=28; MatrixT(B,Tb,m1,m2); m3=30; MatrixMutiply(Tb,P,temp1,m2,m1,m3); m3=m2;m1=m2;m2=30; MatrixMutiply(temp1,B,Nbb,m1,m2,m3); m1=27;m2=30;m3=1; MatrixMutiply(temp1,L,W,m1,m2,m3); /矩陣輸出 D:111導線網輸出數(shù)據(jù)3027.txt文本 FILE *fp;fp=fopen(D:111導線網輸出數(shù)據(jù)3027.txt,w);if(fp!=NULL)

13、fprintf(fp,距離近似值so(單位:m):t);fprintf(fp,方位角近似值alfo(單位:弧度):n);for(i=0;i15;i+) fprintf(fp,%4.12lft,soi);fprintf(fp,%.12lfn,alfoi);fprintf(fp,Xo(單位:mm):t);fprintf(fp,Yo(單位:mm):);fprintf(fp,n);for(i=0;i15;i+) fprintf(fp,%.6lft,Xoi); fprintf(fp,%.6lf,Yoi);fprintf(fp,n);fprintf(fp,B矩陣:);fprintf(fp,n);for(i

14、=0;i30;i+)for(j=0;j27;j+)fprintf(fp,%.6f ,Bij);fprintf(fp,n);fprintf(fp,L矩陣(單位:秒和mm):);fprintf(fp,n);for(i=0;i30;i+) fprintf(fp,%.6lf ,Li0);fprintf(fp,n);fprintf(fp,P矩陣:);fprintf(fp,n);for(i=0;i30;i+)for(j=0;j30;j+)fprintf(fp,%.6f ,Pij);fprintf(fp,n);fprintf(fp,Nbb矩陣:);fprintf(fp,n);for(i=0;i27;i+)f

15、or(j=0;j27;j+)fprintf(fp,%.12f ,Nbbij);fprintf(fp,n);fclose(fp); /寫入完畢,關閉文件 DinV(Nbb,27); /MatrixResult=c * Nbb的逆 ,此時 Nbb已經變成Nbb的逆 /計算xm1=27;m2=27;m3=1; MatrixMutiply(Nbb,W,xgu,m1,m2,m3);double xgu285050,sigma_xy285050;xgu2800=xgu00; for(i=1;i27;i+) xgu28i+10=xgui0; xgu2810=0.0; /計算X(即Xgu估值) Xgu00=5

16、000.0; Ygu00=5000.0; for(i=0;i14;i+) Xgui+10=Xoi+1+xgu282*i0/1000.0; Ygui+10=Yoi+1+xgu282*i+10/1000.0; /精度評定 m1=30;m2=27;m3=1; MatrixMutiply(B,xgu,temp5,m1,m2,m3);for(i=0;i30;i+)if(i15)Vi0=(temp5i0-Li0);elseVi0=(temp5i0-Li0); m1=30;m2=1;MatrixT(V,TV,m1,m2);m1=1;m2=30;m3=30; MatrixMutiply(TV,P,temp4,

17、m1,m2,m3);m1=1;m2=30;m3=1;MatrixMutiply(temp4,V,temp4,m1,m2,m3);sigma_gu=sqrt(temp400/3); /單位權中誤差 double vv=0.0; for (i=0;i15;i+) for (j=0;j1;j+) vv=vv+Vij; /puts(); printf(%lft,vv); for(i=0;i27;i+) for(j=0;j27;j+) Qij=Nbbij; for(i=0;i27;i+) sigma_xyi0=sqrt(Qii)*sigma_gu; /坐標平差值中誤差 /printf(%lfn,sigm

18、a_xyi0); sigma_xy2800=sigma_xy00; for(i=1;i27;i+) sigma_xy28i+10=sigma_xyi0; sigma_xy2810=0.0; /printf(%.10lfn,Ncc00); FILE *fp1;fp1=fopen(D:111導線網輸出數(shù)據(jù)3027.txt,a);fprintf(fp1,Nbb的逆:);fprintf(fp1,n);for(i=0;i27;i+)for(j=0;j27;j+) fprintf(fp1,%lf ,Nbbij);fprintf(fp1,n);fprintf(fp1,W:);fprintf(fp1,n);f

19、or(i=0;i27;i+)for(j=0;j1;j+) fprintf(fp1,%.12lf ,Wij);fprintf(fp1,n);fprintf(fp1,x(單位:mm):);fprintf(fp1,n);for(i=0;i28;i+)for(j=0;j1;j+) fprintf(fp1,%.10lf ,xgu28ij);fprintf(fp1,n);fprintf(fp1,V(單位:秒和mm):);fprintf(fp1,n);for(i=0;i30;i+)for(j=0;j1;j+) fprintf(fp1,%.10lf ,Vij);fprintf(fp1,n);fprintf(f

20、p1,X(單位:m):t);fprintf(fp1,Y(單位:m):);fprintf(fp1,n);for(i=0;i15;i+)for(j=0;j1;j+) fprintf(fp1,%.6lft,Xguij); fprintf(fp1,%.6lf,Yguij);fprintf(fp1,n);fprintf(fp1,單位權中誤差(單位:mm):n);fprintf(fp1,%.10lfn,sigma_gu);fprintf(fp1,X坐標平差值中誤差(單位:mm):t);fprintf(fp1,Y坐標平差值中誤差(單位:mm):);fprintf(fp1,n);for(i=0;i13;i+)

21、 fprintf(fp1,%lftt,sigma_xy282*i0); fprintf(fp1,%lf,sigma_xy282*i+10);fprintf(fp1,n);C語言畫圖程序/導線網概略圖 #include #include #include #define NUM 30LRESULT CALLBACK WndProc (HWND, UINT, WPARAM, LPARAM) ;int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance,PSTR szCmdLine, int iCmdShow)static cha

22、r szAppName = SineWave ;HWND hwnd ;MSG msg ;WNDCLASSEX wndclass ;wndclass.cbSize = sizeof (wndclass) ;wndclass.style = CS_HREDRAW | CS_VREDRAW ;wndclass.lpfnWndProc = WndProc ;wndclass.cbClsExtra = 0 ;wndclass.cbWndExtra = 0 ;wndclass.hInstance = hInstance ;wndclass.hIcon = LoadIcon (NULL, IDI_APPLI

23、CATION) ;wndclass.hCursor = LoadCursor (NULL, IDC_ARROW) ;wndclass.hbrBackground = (HBRUSH) GetStockObject (WHITE_BRUSH) ;wndclass.lpszMenuName = NULL ;wndclass.lpszClassName = szAppName ;wndclass.hIconSm = LoadIcon (NULL, IDI_APPLICATION) ;RegisterClassEx (&wndclass) ;hwnd = CreateWindow (szAppName

24、, 控制網圖,WS_OVERLAPPEDWINDOW,CW_USEDEFAULT, CW_USEDEFAULT,CW_USEDEFAULT, CW_USEDEFAULT,NULL, NULL, hInstance, NULL) ;ShowWindow (hwnd, iCmdShow) ;UpdateWindow (hwnd) ;while (GetMessage (&msg, NULL, 0, 0)TranslateMessage (&msg) ;DispatchMessage (&msg) ;return msg.wParam ;LRESULT CALLBACK WndProc (HWND

25、hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam)static int cxClient, cyClient ;HDC hdc ;int i ;PAINTSTRUCT ps ;POINT pt NUM ;switch (iMsg)case WM_SIZE:cxClient = LOWORD (lParam) ;cyClient = HIWORD (lParam) ;return 0 ;case WM_PAINT:hdc = BeginPaint (hwnd, &ps) ; double y16=500.0,363.2211,250.8730,245.2

26、811,343.9816,399.8183,506.0272,596.9804,690.1846,686.1801,688.9648,550.4837,552.8629,499.4146,497.8342,500.0;double x16=500.0,500.0,506.038,269.917,264.999,268.990,346.426,388.125,405.382,466.024,553.062,555.201,651.049,652.317,591.707,500.0;for (i = 0 ; i 16 ; i+)pti.x = xi;pti.y = yi;Polyline (hdc

27、, pt, 16);return 0 ;case WM_DESTROY:PostQuitMessage (0) ;return 0 ;return DefWindowProc (hwnd, iMsg, wParam, lParam) ;C#程序:Form1:using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Threading

28、.Tasks;using System.Windows.Forms;using System.IO;using System.Collections.Generic;namespace 導線控制網 public partial class Form1 : Form public Form1() InitializeComponent(); public string jisuanjieguo; public const double p = 180*3600/Math.PI; /定義角度轉弧度的函數(shù) public double jiao_hu(double du,double fen,doub

29、le miao) return (du*3600.0+fen*60.0+miao)/p; /定義矩陣運算的類(包括矩陣的加、減、乘、轉置和求逆) public class matrix_yusuan /矩陣相加 public static double, matrix_jia(double, Arry, double, Arry1) int m = Arry.GetLength(0); int n = Arry.GetLength(1); int s = Arry1.GetLength(0); int t = Arry1.GetLength(1); double, temp = new dou

30、blem, n; double, tem = 0; if (m = s & n = t) for (int i = 0; i m; i+) for (int j = 0; j n; j+) tempi, j = Arryi, j + Arry1i, j; return temp; else Console.WriteLine(兩個矩陣大小不同); return tem ; /矩陣相減 public static double, matrix_jian(double, Arry, double, Arry1) int m = Arry.GetLength(0); int n = Arry.Get

31、Length(1); int s = Arry1.GetLength(0); int t = Arry1.GetLength(1); double, temp = new doublem, n; double, tem = 0 ; if (m = s & n = t) for (int i = 0; i m; i+) for (int j = 0; j n; j+) tempi, j = Arryi, j - Arry1i, j; return temp; else Console.WriteLine(兩個矩陣大小不同); return tem; /矩陣轉置 public static dou

32、ble, matrix_t(double, Arry) int m = Arry.GetLength(0); int n = Arry.GetLength(1); double, temp = new doublen, m; for (int i = 0; i n; i+) for (int j = 0; j m; j+) tempi,j = Arryj,i; return temp; /矩陣相乘 public static double, matrix_cheng(double, Arry, double, Arry1) int m = Arry.GetLength(0);/矩陣Arry的行

33、數(shù) int r = Arry.GetLength(1);/矩陣Arry的列數(shù) int k = Arry1.GetLength(0);/矩陣Arry的行數(shù) int n = Arry1.GetLength(1);/矩陣Arry1的列數(shù) double, temp = new doublem, n; double, tem = 0 ; if (r = k) for (int i = 0; i m; i+) for (int j = 0; j n; j+) for (int t = 0; t r; t+) tempi, j += Arryi, t * Arry1t, j; return temp; el

34、se Console.WriteLine(兩個矩陣無法相乘); return tem; /求矩陣Arry的逆矩陣 public static double, matrix_ni(double, Arryni) int Level = Arryni.GetLength(1); double, NArry = new doubleLevel, Level; double HLS = matrix_yusuan.matrix_hls(Arryni); double, BArry = matrix_bansui(Arryni); for (int i = 0; i Level; i+) for (in

35、t j = 0; j Level; j+) NArryi, j = BArryi, j / HLS; return NArry; /求矩陣Arry的伴隨矩陣 public static double, matrix_bansui(double, Arryni) int Level = Arryni.GetLength(1); double, BArry = new doubleLevel,Level; for (int m = 0; m Level; m+) for (int n = 0; n Level; n+) BArrym, n = matrix_yusuan.matrix_yuzi(A

36、rryni, n, m); return BArry; /求矩陣Arry的元素Arryi,j的余子式 public static double matrix_yuzi(double, Arryni, int i, int j)/第i行,第j列,起始值為0 int Level = Arryni.GetLength(1); double, Arry1 = new doubleLevel-1,Level-1; for (int m = 0; m Level - 1; m+) for (int n = 0; n Level - 1; n+) if (m i & n j) Arry1m, n = Arr

37、ynim, n; else if(m = j) Arry1m, n = Arrynim, n + 1; else if (m = i & n = i & n = j) Arry1m, n = Arrynim + 1, n + 1; /根據(jù)矩陣元素的不同位置返回不同的值 if (i + j) % 2 != 0) return (-1)*matrix_yusuan.matrix_hls( Arry1); else return matrix_yusuan.matrix_hls(Arry1); /求行列式 public static double matrix_hls(double, Arryni)

38、 int Level = Arryni.GetLength(1);/簡單來說,對于常用的二維數(shù)組,取0或者1,分別獲取列和行的長度(行數(shù)和列數(shù)) double, dArry = new doubleLevel, Level; for (int i = 0; i Level; i+) for (int j = 0; j Level; j+) dArryi, j = Arrynii, j; int sign = 1; for (int i = 0, j = 0; i Level & j i,且dArrym,j!=0)進行交換 if (dArryi, j = 0) /判斷是否達到了矩陣的最大行 if

39、 (i = Level - 1) return 0; int m = i + 1; /獲取一個dArrym,j不為零的行 for (; dArrym, j = 0; m+) if (m = Level - 1) return 0; /把i行和m行互換 double temp; for (int n = j; n i; s-) for (int s = i + 1; s Level; s+) tmp = dArrys, j; for (int t = j; t Level; t+) dArrys, t -= dArryi, t * (tmp / dArryi, j); double result

40、 = 1; for (int i = 0; i Level; i+) if (dArryi, i != 0) result *= dArryi, i; else return 0; return sign * result; public class aa /用于判斷文件導入和計算是否完成 public static int panduan1 = 0;/panduan1用來判斷是否進行了計算 public static int panduan2 = 0;/panduan2用來判斷是否導入文件 int i; int j; /定義數(shù)組 double, hudu = new double30, 1;

41、 double, bian = new double30, 1; double alf = new double30; double alfo = new double30; double so = new double30; double Xo = new double30; double Yo = new double30; double, B = new double30, 27; double, L = new double30, 1; double, P = new double30, 30; double, W = new double27, 1; double, temp = n

42、ew double30, 30; /此處為Xo Yo,B矩陣賦初值為零 hudu代表夾角,alf方位角,alfo方位角近似值,s距離觀測值,so距離近似值 /double Nbb5050,xgu5050,Xgu301,Ygu301,V5050,sigma_gu,Q5050,sigma_xy5050; double, Nbb = new double27, 27; double, xgu = new double27, 1; double, xgu28 = new double28, 1; double, Xgu = new double30, 1; double, Ygu = new doub

43、le30, 1; double, V = new double30, 1; double, Q = new double27, 27; double, sigma_xy = new double30, 30; double, sigma_xy28 = new double30, 30; double sigma_gu; double D, F, M, sigma_hudu = 2.0, sigma_s; /用來求未知點坐標近似值 private void toolStripMenuItem7_Click(object sender, EventArgs e) if (aa.panduan1 =

44、 1) textBox2.Text = ; textBox2.Text = 近似方位角alfo + tt + rn; for (i = 0; i 15; i+) textBox2.Text += Math.Round(alfoi, 6); textBox2.Text += rnrn; else MessageBox.Show(請先進行計算!, 系統(tǒng)提示); private void toolStripMenuItem10_Click(object sender, EventArgs e) if (aa.panduan1 = 1) textBox2.Text = ; textBox2.Text

45、= P矩陣 + tt + rn; for (i = 0; i P.GetLength(0); i+) for (j = 0; j P.GetLength(1); j+) textBox2.Text += Math.Round(Pi, j, 6) + t; textBox2.Text += rnrn; else MessageBox.Show(請先進行計算!, 系統(tǒng)提示); private void toolStripMenuItem9_Click(object sender, EventArgs e) if (aa.panduan1 = 1) textBox2.Text = B矩陣 + tt

46、+ rn; for (i = 0; i B.GetLength(0); i+) for (j = 0; j B.GetLength(1); j+) textBox2.Text += Math.Round(Bi, j, 6) + t; textBox2.Text += rnrn; else MessageBox.Show(請先進行計算!, 系統(tǒng)提示); private void button15_Click(object sender, EventArgs e) if (aa.panduan2 = 1) alf0 = Math.PI; alfo0 = Math.PI; Xo0 = 5000.0;

47、 Yo0 = 5000.0; Xo15 = 5000.0; Yo15 = 5000.0; so0 = bian0, 0; for (i = 1; i = (2 * Math.PI) alfi = alfi - 2 * Math.PI; Xoi = Xoi - 1 + biani - 1, 0 * Math.Cos(alfi - 1); Yoi = Yoi - 1 + biani - 1, 0 * Math.Sin(alfi - 1); jisuanjieguo += 近似距離(單位:m): + r + 近似方位角(單位:弧度): + rn; jisuanjieguo += Math.Round

48、(so0, 3) + tt + Math.Round(alfo0, 6) + rn; for (i = 1; i 0 & (Xoi + 1 - Xoi) 0)/第一象限 alfoi = Math.Atan(Yoi + 1 - Yoi) / (Xoi + 1 - Xoi); else if (Yoi + 1 - Yoi) 0 & (Xoi + 1 - Xoi) 0)/第二象限 alfoi = Math.Atan(Yoi + 1 - Yoi) / (Xoi + 1 - Xoi) + Math.PI; else if (Yoi + 1 - Yoi) 0)/第三象限 alfoi = Math.Atan

49、(Yoi + 1 - Yoi) / (Xoi + 1 - Xoi) + 2 * Math.PI; else /(Yoi-Yoi-1)0&(Xoi-Xoi-1)0)/第四象限 alfoi = Math.Atan(Yoi + 1 - Yoi) / (Xoi + 1 - Xoi) + Math.PI; jisuanjieguo += Math.Round(soi, 3) + tt + Math.Round(alfoi, 6) + rn; /將第一個角度的系數(shù)單獨算出 j = 0; /B0j=0.0;(Yo14-Yo0)/(so14*so14)*p/1000.0; /B0j+1=0.0;-1*(Xo1

50、4-Xo0)/(so14*so14)*p/1000.0; B0, j = -1 * (Yo1 - Yo0) / (so0 * so0) * p / 1000.0; /B0j+1=(Xo1-Xo0)/(so0*so0)*p/1000.0; B0, 25 = (Yo14 - Yo0) / (so14 * so14) * p / 1000.0; B0, 26 = -1 * (Xo14 - Xo0) / (so14 * so14) * p / 1000.0; /將第二個角度的系數(shù)單獨算出 B1, j = (Yo2 - Yo1) / (so1 * so1) - (Yo0 - Yo1) / (so0 *

51、so0) * p / 1000.0; /B1j+1=-1*(Xo2-Xo1)/(so1*so1)-(Xo0-Xo1)/(so0*so0)*p/1000.0; B1, j + 1 = -1 * (Yo2 - Yo1) / (so1 * so1) * p / 1000.0; B1, j + 2 = (Xo2 - Xo1) / (so1 * so1) * p / 1000.0; /i = i + 1; /將第三個角度的系數(shù)單獨算出 i = 2; Bi, j = (Yoi - 1 - Yoi) / (soi - 1 * soi - 1) * p / 1000.0; /Bi, j + 1 = -1 *

52、(Xoi - 1 - Xoi) / (soi - 1 * soi - 1) * p / 1000.0; Bi, j + 1 = (Yoi + 1 - Yoi) / (soi * soi) - (Yoi - 1 - Yoi) / (soi - 1 * soi - 1) * p / 1000.0; Bi, j + 2 = -1 * (Xoi + 1 - Xoi) / (soi * soi) - (Xoi - 1 - Xoi) / (soi - 1 * soi - 1) * p / 1000.0; Bi, j + 3 = -1 * (Yoi + 1 - Yoi) / (soi * soi) * p

53、/ 1000.0; Bi, j + 4 = (Xoi + 1 - Xoi) / (soi * soi) * p / 1000.0; /求其他角度改正的系數(shù) for (i = 3; i 15; i+) if (i 14) Bi, j + 1 = (Yoi - 1 - Yoi) / (soi - 1 * soi - 1) * p / 1000.0; Bi, j + 2 = -1 * (Xoi - 1 - Xoi) / (soi - 1 * soi - 1) * p / 1000.0; Bi, j + 3 = (Yoi + 1 - Yoi) / (soi * soi) - (Yoi - 1 - Yo

54、i) / (soi - 1 * soi - 1) * p / 1000.0; Bi, j + 4 = -1 * (Xoi + 1 - Xoi) / (soi * soi) - (Xoi - 1 - Xoi) / (soi - 1 * soi - 1) * p / 1000.0; Bi, j + 5 = -1 * (Yoi + 1 - Yoi) / (soi * soi) * p / 1000.0; Bi, j + 6 = (Xoi + 1 - Xoi) / (soi * soi) * p / 1000.0; else Bi, j + 1 = (Yoi - 1 - Yoi) / (soi - 1

55、 * soi - 1) * p / 1000.0; Bi, j + 2 = -1 * (Xoi - 1 - Xoi) / (soi - 1 * soi - 1) * p / 1000.0; Bi, j + 3 = (Yoi + 1 - Yoi) / (soi * soi) - (Yoi - 1 - Yoi) / (soi - 1 * soi - 1) * p / 1000.0; Bi, j + 4 = -1 * (Xoi + 1 - Xoi) / (soi * soi) - (Xoi - 1 - Xoi) / (soi - 1 * soi - 1) * p / 1000.0; j = j +

56、2; /求邊長改正的系數(shù) j = 0; /將第一個邊長的系數(shù)單獨算出 Bi, 0 = (Xo1 - Xo0) / so0; /(Xo1-Xo0)/(so0*so0); i = i + 1; /將第二個邊長的系數(shù)單獨算出 Bi, j = -1 * (Xoi - 14 - Xoi - 15) / soi - 15; /Bi, j + 1 = -1 * (Yoi - 14 - Yoi - 15) / soi - 15; Bi, j + 1 = -1 * Bi, j; Bi, j + 2 = (Yoi - 14 - Yoi - 15) / soi - 15; for (i = i + 1; i 30;

57、 i+) if (i 29) Bi, j + 1 = -1 * (Xoi - 14 - Xoi - 15) / soi - 15; Bi, j + 2 = -1 * (Yoi - 14 - Yoi - 15) / soi - 15; Bi, j + 3 = -1 * Bi, j + 1; Bi, j + 4 = -1 * Bi, j + 2; else Bi, j + 1 = -1 * (Xoi - 14 - Xoi - 15) / soi - 15; Bi, j + 2 = -1 * (Yoi - 14 - Yoi - 15) / soi - 15; j = j + 2; jisuanjie

58、guo += B矩陣: + rn; for (i = 0; i 30; i+) for (j = 0; j 27; j+) jisuanjieguo += Math.Round(Bi, j, 6) + t; jisuanjieguo += rn; /求L矩陣,角度和邊長分別求解 L0, 0 = (hudu0, 0 - (alfo0 - alfo14 + Math.PI) * p; for (i = 1; i 30; i+) if (i Math.PI * p) Li, 0 = (Li, 0 - 2 * Math.PI * p); else Li, 0 = Li, 0; else Li, 0 =

59、 (biani - 15, 0 - soi - 15) * 1000.0; jisuanjieguo += L矩陣(單位:秒和mm): + rn; for (i = 0; i 30; i+) for (j = 0; j 1; j+) jisuanjieguo += Math.Round(Li, j, 6) + tt; jisuanjieguo += rn; /求權陣P for (i = 0; i 30; i+) if (i 15) Pi, i = 1; else sigma_s = 5 + 10 * 0. * biani - 15, 0 * 1000; /單位為(/mm)的平方 Pi, i =

60、 sigma_hudu * sigma_hudu / (sigma_s * sigma_s); jisuanjieguo += P矩陣: + rn; for (i = 0; i 30; i+) for (j = 0; j 30; j+) jisuanjieguo += Math.Round(Pi, j, 6) + t; jisuanjieguo += rn; Nbb = matrix_yusuan.matrix_cheng(matrix_yusuan.matrix_cheng(matrix_yusuan.matrix_t(B), P), B); /計算Nbb矩陣 double, temp2 =

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網頁內容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
  • 4. 未經權益所有人同意不得將文件中的內容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網僅提供信息存儲空間,僅對用戶上傳內容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內容本身不做任何修改或編輯,并不能對任何下載內容負責。
  • 6. 下載文件中如有侵權或不適當內容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論