private static RunJSON.Position PointToPosition(RunJSON.Position startposition, Point startpoint, Point point, double scale) { double dx = (point.X - startpoint.X) * scale * 1.2; double dy = (point.Y - startpoint.Y) * scale; return(new RunJSON.Position(startposition.Latitude - dy, startposition.Longitude + dx)); }
private static Point PositionToPoint(RunJSON.Position startposition, Point startpoint, RunJSON.Position position, double scale) { double dlon = (position.Longitude - startposition.Longitude) / scale / 1.2; double dlat = (position.Latitude - startposition.Latitude) / scale; return(new Point(startpoint.X + (int)Math.Round(dlon), startpoint.Y - (int)Math.Round(dlat))); }