zoukankan      html  css  js  c++  java
  • 二阶段12.13

            今天,我们为三角高程计算设计了窗口及控件,并且增加了

    度分秒快捷键,使得输入更加方便。增加了度娘和资料标准

    的链接,方便在疑惑的时候查询。增加一个高程小计,方便

    查看和记录,使得数据很客观。同时也将程序编写完成。

    真的累啊!!

    程序代码:

    private void button2_Click(object sender, EventArgs e)
    {
    string s = textBox1.Text;
    string[] ss = s.Split(new char[3] { '°', '′', '″' }, StringSplitOptions.RemoveEmptyEntries);
    double[] d = new double[ss.Length];
    double sign = d[0] >= 0.0 ? 1.0 : -1.0;
    for (int i = 0; i < d.Length; i++)
    d[i] = Convert.ToDouble(ss[i]);

    double rad = 0;
    if (d.Length == 1)
    rad = d[0] * Math.PI / 180;
    else if (d.Length == 2)
    rad = (d[0] + d[1] / 60) * Math.PI / 180;
    else
    rad = (d[0] + d[1] / 60 + d[2] / 3600) * Math.PI / 180;
    rad = sign * rad;

    textBox3.Text = Convert.ToString(Math.Round(Math.Sin(rad), 5));
    textBox4.Text = Convert.ToString(Math.Round(Math.Cos(rad), 5));
    textBox2.Text = Convert.ToString(Math.Round(rad, 5));
    double xieju = Convert.ToDouble(textBox5.Text);
    double yigao = Convert.ToDouble(textBox10.Text);
    double chigao = Convert.ToDouble(textBox11.Text);
    textBox6.Text = Convert.ToString(Math.Round((Math.Sin(rad) * xieju + yigao - chigao), 5));
    textBox7.Text = Convert.ToString(Math.Round(xieju * Math.Cos(rad), 5));
    textBox8.AppendText(textBox6.Text);
    textBox8.AppendText(" ");
    }

  • 相关阅读:
    第47课 父子间的冲突
    第46课 继承中的构造与析构
    第45课 不同的继承方式
    3.天线-网络规划-网络优化
    2.多址技术
    断剑重铸013
    断剑重铸012
    断剑重铸011
    1.LTE系统概述
    断剑重铸010
  • 原文地址:https://www.cnblogs.com/wtctd/p/10117166.html
Copyright © 2011-2022 走看看