public StadtListe(int id, string name, string country, string lon, string lat) { Id = id; Name = name; Country = country; Coord = new Koordinaten(lon, lat); }
private Koordinaten?_currentCoords; // = new Koordinaten() {XReal = 1000, YReal = 1000} ; public void SetCoordinates(Koordinaten coords) { if (_currentCoords?.XReal == coords.XReal && _currentCoords?.YReal == coords.YReal) { return; } _lastCoords = _currentCoords; _currentCoords = coords; }
public Needle Calculate(Koordinaten last, Koordinaten current) { current = new Koordinaten() { XReal = current.XReal - last.XReal, YReal = current.YReal - last.YReal }; double f = Math.Max(Math.Abs(current.XReal), Math.Abs(current.YReal)) / Convert.ToDouble(CompassSize); if (f == 0) { } current = new Koordinaten() { XReal = Convert.ToInt32(current.XReal / f) + CompassSize, YReal = 100 - (Convert.ToInt32(current.YReal / f) + CompassSize) }; return(new Needle() { From = new Point(50, 50), To = new Point(current.XReal, current.YReal) }); }