ImageVerifierCode 换一换
格式:DOCX , 页数:38 ,大小:439.66KB ,
资源ID:19686252      下载积分:3 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bdocx.com/down/19686252.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(计算机测绘程序设计实验报告东华理工Word文档格式.docx)为本站会员(b****6)主动上传,冰豆网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰豆网(发送邮件至service@bdocx.com或直接QQ联系客服),我们立即给予删除!

计算机测绘程序设计实验报告东华理工Word文档格式.docx

1、清空Label1角度:Label2弧度:Text1txt_jd无定义Text2txt_hd(3)程序代码Private Sub Cmd_jh_Click()Const pi# = 3.14159265358979 定义常量piDim d%, f%, m#, fh%, jdzh%jd = txt_jd.Textfh = Sgn(jd) 获取输入角度的正负号jd = Abs(jd) 取输入角度的绝对值d = Int(jd) 提取度f = Int(jd - d) * 100) 提取分m = (jd - d) * 100 - f) * 100 提取秒jdzh = (d + f / 60 + m / 3

2、600) 得到角度总和,单位为度hd = Format(jd * pi / 180 * fh, 0.000000) 保留6位小数txt_hd.Text = hdEnd SubPrivate Sub Cmd_hj_Click()Dim d%, f%, m#, fh%hd = txt_hd.Textfh = Sgn(hd) 获取输入弧度的正负号jdzh = Abs(hd) * 180 / pi 将弧度转换为角度,单位为度d = Int(jdzh) f = Int(jdzh - d) * 60) m = (jdzh - d) * 60 - f) * 60 jd = Format(d + f / 10

3、0 + m / 10000) * fh, 0.0000得到度.分秒并保留四位小数txt_jd.Text = jdPrivate Sub Cmd_qk_Click()txt_jd.Text = txt_hd.Text = (4)运行结果实验二 矩阵的加、减、乘、转置、求逆根据矩阵的运算方法及规则,只有当两个矩阵是同型矩阵时,这两个矩阵才能进行加法和减法运算。只有当第一个矩阵(左矩阵)的列数等于第二个矩阵(右矩阵)的行数时,两个矩阵才能相乘。矩阵的转置是行变列,列变行。矩阵的求逆:。首先提取矩阵中的数据,再利用调用函数完成矩阵运算。frm_jzys矩阵运算(彭思强)Cmd_jiaA+BCmd_ji

4、anA-BCmd_chengA*BCommand4Cmd_zhuanzhiATCommand5Cmd_qiuniA-1Command6Cmd_qc清除ABLabel3 CTxt_aTxt_bText3Txt_cOption Base 1 数组从1开始Dim A() As DoubleDim B() As DoubleDim C() As Double矩阵相加运算提取数据Private Sub Cmd_jia_Click()Dim i As IntegerDim j As IntegerDim m1 As IntegerDim n1 As IntegerDim m2 As IntegerDim

5、n2 As IntegerDim mystring() As StringDim l() As String 提取矩阵A的数据mystring() = Split(Txt_a.Text, vbCrLf)m1 = UBound(mystring, 1) - LBound(mystring, 1) + 1 获取行数l() = Split(mystring(0), 第一行数据n1 = UBound(l, 1) - LBound(l, 1) + 1 获取列数ReDim A(m1, n1) 重新定义矩阵AFor i = 1 To m1 l() = Split(mystring(i - 1), ) n1

6、= UBound(l, 1) - LBound(l, 1) + 1 For j = 1 To n1 A(i, j) = l(j - 1) Next jNext i提取矩阵B的数据mystring() = Split(Txt_b.Text, vbCrLf)m2 = UBound(mystring, 1) - LBound(mystring, 1) + 1 n2 = UBound(l, 1) - LBound(l, 1) + 1 ReDim B(m2, n2) 重新定义矩阵BFor i = 1 To m2 n2 = UBound(l, 1) - LBound(l, 1) + 1 For j = 1

7、 To n2 B(i, j) = l(j - 1) 获取矩阵BReDim C(m1, n1) 重新定义矩阵CCall madd(A, B, C) 调用矩阵相加的函数Txt_c.Text = Txt_c.Text = Txt_c.Text + Str(C(i, j) + Txt_c.Text = Txt_c.Text + vbCrLf矩阵相减运算提取数据Private Sub Cmd_jian_Click() A(i, j) = l(j - 1) 获取矩阵ACall mcut(A, B, C) 调用矩阵相减的函数矩阵相乘运算提取数据Private Sub Cmd_cheng_Click()ReD

8、im C(m1, n2) Call mmul(A, B, C) 调用矩阵相乘的函数矩阵转置提取数据Private Sub Cmd_zhuanzhi_Click()Dim AT() As DoubleReDim AT(n1, m1) 重新定义矩阵ATCall mtrans(A, AT) 调用矩阵转置的函数For i = 1 To n1 For j = 1 To m1 Txt_c.Text = Txt_c.Text + Str(AT(i, j) + Next i矩阵求逆提取数据Private Sub Cmd_qiuni_Click()重新定义Call MRinv(A) 调用矩阵求逆的函数 Txt_

9、c.Text = Txt_c.Text + Str(A(i, j) + Cmd_qc_Click()事件完成数据的清除Private Sub Cmd_qc_Click()Txt_a.Text = Txt_b.Text = Sub madd(mtxA() As Double, mtxB() As Double, mtxC() As Double) 矩阵相加 Dim i As Integer, j As Integer Dim m As Integer, n As Integer m = UBound(mtxA, 1) - LBound(mtxA, 1) + 1 n = UBound(mtxA,

10、2) - LBound(mtxA, 2) + 1 For i = 1 To m For j = 1 To n mtxC(i, j) = mtxA(i, j) + mtxB(i, j)Sub mcut(mtxA() As Double, mtxB() As Double, mtxC() As Double) 矩阵相减 mtxC(i, j) = mtxA(i, j) - mtxB(i, j)Sub mmul(mtxA() As Double, mtxB() As Double, mtxC() As Double) 矩阵相乘 Dim l As Integer, K As Integer l = UB

11、ound(mtxB, 2) - LBound(mtxB, 2) + 1 For j = 1 To l For K = 1 To n mtxC(i, j) = mtxC(i, j) + mtxA(i, K) * mtxB(K, j) Next KSub mtrans(mtxA() As Double, mtxAT() As Double) 矩阵转置 For i = 1 To n For j = 1 To m mtxAT(i, j) = mtxA(j, i)Function MRinv(mtxA() As Double) As Boolean 矩阵求逆Dim n As Integern = UBo

12、und(mtxA, 1) - LBound(mtxA, 1) + 1ReDim nIs(0 To n) As Integer, nJs(0 To n) As IntegerDim i As Integer, j As Integer, K As IntegerDim D As Double, p As DoubleFor K = 1 To nD = 0#For i = K To n For j = K To n p = Abs(mtxA(i, j) If (p D) Then D = p nIs(K) = i nJs(K) = j End IfNext jIf (D + 1# = 1#) Th

13、en MRinv = False Exit FunctionEnd IfIf (nIs(K) K) Then p = mtxA(K, j) mtxA(K, j) = mtxA(nIs(K), j) mtxA(nIs(K), j) = pIf (nJs(K) p = mtxA(i, K) mtxA(i, K) = mtxA(i, nJs(K) mtxA(i, nJs(K) = pmtxA(K, K) = 1# / mtxA(K, K)For j = 1 To n If (j K) Then mtxA(K, j) = mtxA(K, j) * mtxA(K, K)For i = 1 To n If

14、 (i K) Then mtxA(i, j) = mtxA(i, j) - mtxA(i, K) * mtxA(K, j) K) Then mtxA(i, K) = -mtxA(i, K) * mtxA(K, K)Next KFor K = n To 1 Step -1 If (nJs(K) mtxA(K, j) = mtxA(nJs(K), j) mtxA(nJs(K), j) = p mtxA(i, K) = mtxA(i, nIs(K) mtxA(i, nIs(K) = pMRinv = TrueEnd Function实验三 坐标正反算1.坐标正算已知一点坐标A(XA,YA)、水平距离DAB和坐标方位角AB,求另一点坐标B(XB,YB)。利用角度与弧度的相互转换函数,根据坐标正算公式XB=XA+DAB*Cos(AB),YB=YA+DAB* Sin(AB)计算出B点坐标。窗体、框架等控件属性设置frm_zbzs坐标正算(彭思强)Cmd_js计算

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1