ich habe ein Porblem und keine Ahnung wie ich es lösen kann,
Ich habe als übung ein Rechner Programmiert der die Entfernung zweier Punkte
mittels GPS daten ermittelt.
Code:
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 Geo_Rechner { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void btnRechnen_Click(object sender, EventArgs e) { double dLaengePosition1 = 0; double dBreitePosition1 = 0; double dLaengePosition2 = 0; double dBreitePosition2 = 0; double dDist = 0; dLaengePosition1 = Convert.ToDouble(tBoxP1L); dBreitePosition1 = Convert.ToDouble(tBoxP1B); dLaengePosition2 = Convert.ToDouble(tBoxP2L); dBreitePosition2 = Convert.ToDouble(tBoxP2B); dDist = 6378.388 * Math.Acos(Math.Sin(dBreitePosition1) * Math.Sin(dBreitePosition2) + Math.Cos(dBreitePosition1) * Math.Cos(dBreitePosition2) * Math.Cos(dLaengePosition2 - dLaengePosition1)); lbAusgabe.Text += Convert.ToString(dDist); lbAusgabe.Text += " Kilometer."; } } }
Obwohl ich meines erachtens alles Korrekt gemacht hab.
Ich hoffe ihr könnt mir helfen
Mit freundlichen Grüßen,
Önte