コード例 #1
0
 static void Main(string[] args)
 {
     try {
         NormalGravity grav = new NormalGravity(NormalGravity.StandardModels.WGS84);
         double        lat = 27.99, h = 8820; // Mt Everest
         double        gammay, gammaz;
         grav.Gravity(lat, h, out gammay, out gammaz);
         Console.WriteLine(String.Format("{0} {1}", gammay, gammaz));
     }
     catch (GeographicErr e) {
         Console.WriteLine(String.Format("Caught exception: {0}", e.Message));
     }
 }
コード例 #2
0
 static void Main(string[] args)
 {
     try {
         NormalGravity grav = new NormalGravity(NormalGravity.StandardModels.WGS84);
         double lat = 27.99, h = 8820; // Mt Everest
         double gammay, gammaz;
         grav.Gravity(lat, h, out gammay, out gammaz);
         Console.WriteLine(String.Format("{0} {1}", gammay, gammaz));
     }
     catch (GeographicErr e) {
         Console.WriteLine(String.Format("Caught exception: {0}", e.Message));
     }
 }
コード例 #3
0
        private void OnValidate(object sender, EventArgs e)
        {
            try
            {
                double lon = -86.0;
                double lat = 32.0;
                double alt = 0.0;

                double       x, y, z;
                GravityModel gm = new GravityModel(m_name, m_path);
                gm.Disturbance(lat, lon, alt, out x, out y, out z);
                gm.GeoidHeight(lat, lon);
                gm.Gravity(lat, lon, alt, out x, out y, out z);
                gm.Phi(5000000.0, 5000000.0, out x, out y);
                gm.SphericalAnomaly(lat, lon, alt, out x, out y, out z);
                gm.T(5000000.0, 5000000.0, 5000000.0);
                gm.U(5000000.0, 5000000.0, 5000000.0, out x, out y, out z);
                gm.V(5000000.0, 5000000.0, 5000000.0, out x, out y, out z);
                gm.W(5000000.0, 5000000.0, 5000000.0, out x, out y, out z);
                NormalGravity ng = new NormalGravity(NormalGravity.StandardModels.GRS80);
                ng = new NormalGravity(NormalGravity.StandardModels.WGS84);
                ng = new NormalGravity(6378137.0, 3.986005e+14, 7.292115147e-5, 1.08263e-3, false);
                ng = gm.ReferenceEllipsoid();
                ng.DynamicalFormFactor(1);
                Geocentric geo = ng.Earth();
                ng.Gravity(lat, alt, out x, out z);
                ng.Phi(5000000.0, 5000000.0, out x, out y);
                ng.SurfaceGravity(lat);
                ng.U(5000000.0, 5000000.0, 5000000.0, out x, out y, out z);
                ng.V0(5000000.0, 5000000.0, 5000000.0, out x, out y, out z);
                GravityCircle gc = gm.Circle(lat, 0.0, GravityModel.Mask.ALL);
                gc.Capabilities();
                gc.Capabilities(GravityModel.Mask.GRAVITY);
                gc.Disturbance(lon, out x, out y, out z);
                gc.GeoidHeight(lon);
                gc.Gravity(lon, out x, out y, out z);
                gc.SphericalAnomaly(lon, out x, out y, out z);
                gc.T(lon);
                gc.V(lon, out x, out y, out z);
                gc.W(lon, out x, out y, out z);
                MessageBox.Show("No errors detected", "OK", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            catch (Exception xcpt)
            {
                MessageBox.Show(xcpt.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
コード例 #4
0
        private void OnNormGravity(object sender, EventArgs e)
        {
            try
            {
                double lat = Double.Parse(m_latitudeTextBox.Text);
                double alt = Double.Parse(m_altitudeTextBox.Text);

                double        gx, gz;
                NormalGravity ng = m_gm.ReferenceEllipsoid();
                ng.Gravity(lat, alt, out gx, out gz);
                m_accelXTextBox.Text = gx.ToString();
                m_accelYTextBox.Text = "0.0";
                m_accelZTextBox.Text = gz.ToString();
            }
            catch (Exception xcpt)
            {
                MessageBox.Show(xcpt.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
コード例 #5
0
ファイル: GravityPanel.cs プロジェクト: Remdul/Circleplot
        private void OnValidate(object sender, EventArgs e)
        {
            try
            {
                double lon = -86.0;
                double lat = 32.0;
                double alt = 0.0;

                double x, y, z;
                GravityModel gm = new GravityModel(m_name,m_path);
                gm.Disturbance( lat, lon, alt, out x, out y, out z);
                gm.GeoidHeight(lat,lon);
                gm.Gravity(lat,lon,alt,out x,out y, out z);
                gm.Phi(5000000.0,5000000.0,out x,out y);
                gm.SphericalAnomaly(lat,lon,alt,out x, out y, out z);
                gm.T(5000000.0,5000000.0,5000000.0);
                gm.U(5000000.0,5000000.0,5000000.0,out x,out y,out z);
                gm.V(5000000.0,5000000.0,5000000.0,out x,out y,out z);
                gm.W(5000000.0,5000000.0,5000000.0,out x,out y,out z);
                NormalGravity ng = new NormalGravity(NormalGravity.StandardModels.GRS80);
                ng = new NormalGravity( NormalGravity.StandardModels.WGS84);
                ng = new NormalGravity(6378137.0,3.986005e+14,7.292115147e-5,-1.0,1.08263e-3);
                ng = gm.ReferenceEllipsoid();
                ng.DynamicalFormFactor(1);
                Geocentric geo = ng.Earth();
                ng.Gravity(lat,alt,out x, out z);
                ng.Phi(5000000.0,5000000.0,out x,out y);
                ng.SurfaceGravity(lat);
                ng.U(5000000.0,5000000.0,5000000.0,out x, out y, out z);
                ng.V0(5000000.0,5000000.0,5000000.0,out x, out y, out z);
                GravityCircle gc = gm.Circle(lat,0.0,GravityModel.Mask.ALL);
                gc.Capabilities();
                gc.Capabilities(GravityModel.Mask.GRAVITY);
                gc.Disturbance(lon, out x, out y, out z);
                gc.GeoidHeight(lon);
                gc.Gravity(lon, out x, out y, out z);
                gc.SphericalAnomaly(lon, out x, out y, out z);
                gc.T(lon);
                gc.V(lon, out x, out y, out z);
                gc.W(lon, out x, out y, out z);
                MessageBox.Show("No errors detected", "OK", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            catch (Exception xcpt)
            {
                MessageBox.Show(xcpt.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }