歡迎來到http://www.tljciu.live !
當前位置:六六工程資料網建筑課堂工程資料工程測量曲線任意里程中邊樁坐標正反算(VB6.0)函數(5節點法提供測試程序代碼)

曲線任意里程中邊樁坐標正反算(VB6.0)函數(5節點法提供測試程序代碼)

08-22 13:58:44  瀏覽次數:221次  欄目:工程測量
標簽:工程測量規范,工程測量技術, 曲線任意里程中邊樁坐標正反算(VB6.0)函數(5節點法提供測試程序代碼),http://www.tljciu.live
曲線任意里程中邊樁坐標正反算(VB6.0)函數(5節點法提供測試程序代碼)
使用說明:
1. 在VA或VAB中添加一個窗體,并將其"Caption"屬性改為
    "曲線任意里程中邊樁坐標正反算(VB6.0)  函數"

2. 在窗體上添加一個文本框,并將其下列屬性更改為:
     名稱                    txt1  
      MultiLine          True
      ScrollBars          3  Both

3. 在窗體上添加三個命令按鈕,并將它們的下列屬性更改為:
     按鈕一
     名稱                    Cmd1
     Caption                正算
     按鈕二
     名稱                    Cmd2
     Caption                反算
     按鈕三
     名稱                    Cmd3
     Caption                結束

4. 將以下程序復制到VA或VBA的代碼窗口內,點擊運行命令即進行測試。

Private Const pi As Double = 3.14159265358979
Private Const pi As Double = 3.14159265358979

Public Function qxzs(xyb() As Double, sz() As Double, fhz() As Double)
'正算函數(由里程和邊距計算坐標)
'入口參數線元要素xyb()及sz()為:
'xyb(1)=線元起點里程  xyb(2)=線元起點X坐標 xyb(3)=線元起點Y坐標 xyb(4)=線元起點切線方位角(以弧度為單位)
'xyb(5)=線元長度  xyb(6)=線元起點曲率半徑 xyb(7)=線元止點曲率半徑 xyb(8)=線元偏向標志
'sz(1)=要計算點的中線里程 sz(2)=要計算點距中線的邊距
'返回值fhz()為:
'fhz(1)=所求點的X坐標 fhz(2)=所求點的Y坐標 fhz(3)=所求點對應中線點向右的法線方位角
   Dim f0 As Double
   Dim q As Double
   Dim c As Double
   Dim d As Double
   Dim rr(5) As Double
   Dim vv(5) As Double
   Dim i As Integer
   Dim w As Double
   Dim xs As Double
   Dim ys As Double
   Dim ff As Double
  
   f0 = xyb(4): q = xyb(8)
   c = 1# / xyb(6)
   d = (xyb(6) - xyb(7)) / 2# / xyb(5) / xyb(6) / xyb(7)
   rr(1) = 0.1184634425: rr(2) = 0.2393143352
   rr(3) = 0.2844444444: rr(4) = rr(2): rr(5) = rr(1)
   vv(1) = 0.046910077: vv(2) = 0.2307653449
   vv(3) = 0.5: vv(4) = 1# - vv(2): vv(5) = 1# - vv(1)
   w = Abs(sz(1) - xyb(1))
  
   xs = 0: ys = 0
   For i = 1 To 5
       ff = f0 + q * vv(i) * w * (c + vv(i) * w * d)
       xs = xs + rr(i) * Cos(ff)
       ys = ys + rr(i) * Sin(ff)
   Next i
  
   fhz(3) = f0 + q * w * (c + w * d) + 0.5 * pi
   fhz(1) = xyb(2) + w * xs + sz(2) * Cos(fhz(3))
   fhz(2) = xyb(3) + w * ys + sz(2) * Sin(fhz(3))
    
End Function

Public Function qxfs(xyb() As Double, xpt() As Double, fhb() As Double)
'反算函數(由坐標計算里程和邊距)
'入口參數線元要素xyb()及xpt()為:
'xyb(1)=線元起點里程  xyb(2)=線元起點X坐標 xyb(3)=線元起點Y坐標 xyb(4)=線元起點切線方位角(以弧度為單位)
'xyb(5)=線元長度  xyb(6)=線元起點曲率半徑 xyb(7)=線元止點曲率半徑 xyb(8)=線元偏向標志
'xpt(1)=要計算點的X坐標 xpt(2)=要計算點的Y坐標
'返回值fhb()為:
'fhb(1)=所求點的中線里程 fhb(2)=所求點距中線的邊距
  Dim f0 As Double
   Dim q As Double
   Dim c As Double
   Dim d As Double
   Dim rr(4) As Double
   Dim vv(4) As Double
   Dim i As Integer
   Dim w As Double
   Dim xs As Double
   Dim ys As Double
   Dim ff As Double
   Dim z As Double
   Dim sz(2) As Double
  
   f0 = xyb(4): q = xyb(8)
   c = 1# / xyb(6)
   d = (xyb(6) - xyb(7)) / 2# / xyb(5) / xyb(6) / xyb(7)
   ft = f0 - 0.5 * pi
   w = Abs((xpt(2) - xyb(3)) * Cos(ft) - (xpt(1) - xyb(2)) * Sin(ft))
   z = 1
  
   'Txt1.Text = Txt1.Text + "S0=" + Str(xyb(1)) + Chr(13) + Chr(10)
  
   Do While Abs(z) > 0.000001
      sz(1) = xyb(1) + w: sz(2) = z
      Call qxzs(xyb(), sz(), fhb())
      ff = ft + q * w * (c + w * d)
      z = (xpt(2) - fhb(2)) * Cos(ff) - (xpt(1) - fhb(1)) * Sin(ff)
      w = w + z
   Loop
  
    sz(1) = xyb(1) + w: sz(2) = 0
    Call qxzs(xyb(), sz(), fhb())
    
    fhb(1) = xyb(1) + w
    fhb(2) = (xpt(2) - fhb(2)) / Sin(fhb(3))
    
End Function
Private Sub Cmd1_Click()
   '正算測試程序
   Dim qxxy(100, 8) As Double
   Dim xsz(100, 3) As Double
      
   '線元要素表存入數組qxxy中,切線方位角以弧度為單位
   '可采用讀文本文件、Excel數據表中的數據或其它方式讀入數據替代以下直接賦值方式
   qxxy(1, 1) = 500: qxxy(1, 2) = 19942.837: qxxy(1, 3) = 28343.561: qxxy(1, 4) = 2.186466069
   qxxy(1, 5) = 269.256: qxxy(1, 6) = 1E+45: qxxy(1, 7) = 1E+45: qxxy(1, 8) = 0
  
   qxxy(2, 1) = 769.256: qxxy(2, 2) = 19787.34: qxxy(2, 3) = 28563.378: qxxy(2, 4) = 2.186466069
   qxxy(2, 5) = 37.492: qxxy(2, 6) = 1E+45: qxxy(2, 7) = 221.75: qxxy(2, 8) = -1
  
   qxxy(3, 1) = 806.748: qxxy(3, 2) = 19766.566: qxxy(3, 3) = 28594.574: qxxy(3, 4) = 2.101929446
   qxxy(3, 5) = 112.779:  qxxy(3, 6) = 221.75: qxxy(3, 7) = 221.75: qxxy(3, 8) = -1

[1] [2] [3]  下一頁

,曲線任意里程中邊樁坐標正反算(VB6.0)函數(5節點法提供測試程序代碼)
22选五的开奖公告