资源简介
精密星历内插计算 拉格朗日插值法 根据已知时间的x,y,z坐标推算未知时间的坐标 c#
代码片段和文件信息
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace tyttest2
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
double[] arrayx=new double[6] ;
double[] arrayy=new double[6];
double[] arrayz=new double[6];
double[] arrayt = new double[6];
private void button1_Click(object sender EventArgs e)
{
int ik;
double ssxsysz;
double mx = 0;
double my = 0;
double mz = 0;
double t=Convert.ToDouble(textBox29.Text );
arrayx[0] =Convert.ToDouble( textBox26.Text);
//MessageBox.Show(Convert.ToString(arrayx[0]));
arrayx[1] = Convert.ToDouble(textBox23.Text);
arrayx[2] = Convert.ToDouble(textBox6.Text);
arrayx[3] = Convert.ToDouble(textBox10.Text);
arrayx[4] =Convert.ToDouble( textBox14.Text);
arrayx[5] = Convert.ToDouble(textBox18.Text);
arrayy[0] = Convert.ToDouble(textBox27.Text);
arrayy[1] = Convert.ToDouble(textBox22.Text);
arrayy[2] = Convert.ToDouble(textBox7.Text);
arrayy[3] = Convert.ToDouble(textBox11.Text);
arrayy[4] = Convert.ToDouble(textBox15.Text);
arrayy[5] = Convert.ToDouble(textBox19.Text);
arrayz[0] = Convert.ToDouble(textBox28.Text);
arrayz[1] = Convert.ToDouble(textBox21.Text);
arrayz[2] = Convert.ToDouble(textBox8.Text);
arrayz[3] = Convert.ToDouble(textBox12.Text);
arrayz[4] = Convert.ToDouble(textBox16.Text);
arrayz[5] = Convert.ToDouble(textBox20.Text);
arrayt[0] = Convert.ToDouble(textBox25.Text);
arrayt[1] = Convert.ToDouble(textBox24.Text);
arrayt[2] = Convert.ToDouble(textBox5.Text);
arrayt[3] = Convert.ToDouble(textBox9.Text);
arrayt[4] = Convert.ToDouble(textBox13.Text);
arrayt[5] = Convert.ToDouble(textBox17.Text);
for (k=0;k<=5;k++)
{
s = 1;
for (i = 0; i <=5;i++ )
{
if (i == k&i!=5)
{ i = i + 1; }
if (k == 5 & i == 5)
break;
//MessageBox.Show(Convert.ToString (i)+“ “+Convert.ToString (k));
s = s * ((t - arrayt[i]) / (arrayt[k] - arrayt[i])) ;
//MessageBox.Show(Convert.ToString(s));
}
sx = s * arrayx[k];
sy = s * arrayy[k];
sz = s * arrayz[k];
mx = mx + sx;
my = my + sy;
mz = mz + sz;
//MessageB
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 32768 2011-03-29 19:33 tyttest2\tyttest2\bin\Debug\tyttest2.exe
文件 30208 2011-03-29 19:33 tyttest2\tyttest2\bin\Debug\tyttest2.pdb
文件 5632 2011-03-29 21:27 tyttest2\tyttest2\bin\Debug\tyttest2.vshost.exe
文件 3248 2011-03-29 19:36 tyttest2\tyttest2\Form1.cs
文件 39612 2011-03-29 19:36 tyttest2\tyttest2\Form1.Designer.cs
文件 5814 2011-03-29 19:36 tyttest2\tyttest2\Form1.resx
文件 842 2011-03-28 21:05 tyttest2\tyttest2\obj\Debug\tyttest2.csproj.GenerateResource.Cache
文件 32768 2011-03-29 19:33 tyttest2\tyttest2\obj\Debug\tyttest2.exe
文件 180 2011-03-28 21:05 tyttest2\tyttest2\obj\Debug\tyttest2.Form1.resources
文件 30208 2011-03-29 19:33 tyttest2\tyttest2\obj\Debug\tyttest2.pdb
文件 180 2011-03-28 08:45 tyttest2\tyttest2\obj\Debug\tyttest2.Properties.Resources.resources
文件 48 2011-03-28 08:50 tyttest2\tyttest2\obj\tyttest2.csproj.FileList.txt
文件 587 2011-03-29 21:27 tyttest2\tyttest2\obj\tyttest2.csproj.FileListAbsolute.txt
文件 467 2011-03-28 08:21 tyttest2\tyttest2\Program.cs
文件 1212 2011-03-28 08:21 tyttest2\tyttest2\Properties\AssemblyInfo.cs
文件 2871 2011-03-28 08:21 tyttest2\tyttest2\Properties\Resources.Designer.cs
文件 5612 2011-03-28 08:21 tyttest2\tyttest2\Properties\Resources.resx
文件 1092 2011-03-28 08:21 tyttest2\tyttest2\Properties\Settings.Designer.cs
文件 249 2011-03-28 08:21 tyttest2\tyttest2\Properties\Settings.settings
文件 3223 2011-03-28 08:50 tyttest2\tyttest2\tyttest2.csproj
文件 913 2011-03-28 08:50 tyttest2\tyttest2.sln
..A..H. 13824 2011-03-29 22:17 tyttest2\tyttest2.suo
目录 0 2011-03-28 08:50 tyttest2\tyttest2\obj\Debug\TempPE
目录 0 2011-03-28 19:54 tyttest2\tyttest2\bin\Debug
目录 0 2011-03-28 08:50 tyttest2\tyttest2\bin\Release
目录 0 2011-03-29 19:33 tyttest2\tyttest2\obj\Debug
目录 0 2011-03-28 08:50 tyttest2\tyttest2\obj\Release
目录 0 2011-03-28 19:54 tyttest2\tyttest2\bin
目录 0 2011-03-28 19:54 tyttest2\tyttest2\obj
目录 0 2011-03-28 19:54 tyttest2\tyttest2\Properties
............此处省略5个文件信息
评论
共有 条评论