话不多说,直接上代码
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace _高斯投影
{
public partial class Form2 : Form
{
public Form2()
{
InitializeComponent();
}
double DD2RAD(double n)
{
double DD; double MM; double SS;
DD = Math.Floor(n);
MM = Math.Floor((n - DD) * 100);
SS = ((n - DD) * 100 - MM) * 100;
n = (DD + MM / 60.0 + SS / 3600.0) * Math.PI / 180.0;
return n;
}
private void Form2_Load(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
double B, L;
B = double.Parse(textBox1.Text);
B = DD2RAD(B);
L = double.Parse(textBox2.Text);
L = DD2RAD(L);
double L0 = double.Parse(textBox3.Text);
L0 = DD2RAD(L0);
double a = double.Parse(textBoxa.Text);
double e2 = double.Parse(textBoxe2.Text);
double A = 1.0 + 3.0 * e2 / 4 + 45.0 * e2 * e2 / 64 + 175.0 * Math.Pow(e2, 3) / 256 + 11025.0 * Math.Pow(e2, 4) / 16384 + 43659.0 * Math.Pow(e2, 5) / 65536;
double B0 = 3.0 * e2 / 4 + 15.0 * e2 * e2 / 16 + 525.0 * Math.Pow(e2, 3) / 512 + 2205.0 * Math.Pow(e2, 4) / 2048 + 72765.0 * Math.Pow(e2, 5) / 65536;
double C = 15.0 * e2 * e2 / 64 + 105.0 * Math.Pow(e2, 3) / 256 + 2205.0 * Math.Pow(e2, 4) / 4096 + 10395.0 * Math.Pow(e2, 5) / 16384;
double D = 35.0 * Math.Pow(e2, 3) / 512 + 315.0 * Math.Pow(e2, 4) / 2048 + 31185.0 * Math.Pow(e2, 5) / 131072;
double α = A * a * (1 - e2);//α
double β = -B0 * a * (1 - e2) / 2.0;//β
double γ = C * a * (1 - e2) / 4.0;
double σ = -D * a * (1 - e2) / 6.0;
double X
2021-06-19 23:19:19
5KB
c#
1