private void DrawCanvas_MouseDown(object sender, MouseButtonEventArgs e) { Point p = Mouse.GetPosition(DrawCanvas); Atia atia = new Atia(this, p.X, p.Y); atia.Run(false); }
private void printAtia(double dist, int angle) { if (dist == 0) { return; } double scaleDistance; Point p = new Point(); scaleDistance = map(0, 0.5, 0, lineLength - 30, dist); p.X = lineLength + Math.Cos(angle * Math.PI / 180) * scaleDistance; p.Y = lineLength - Math.Sin(angle * Math.PI / 180) * scaleDistance; Atia atia = new Atia(this, p.X, p.Y); atia.Run(true); }
private void printAtiaIfColizionExist() { if (!ArduinoMode) { Point p = Mouse.GetPosition(DrawCanvas); if (Math.Round(((p.Y - DrawCanvas.ActualHeight) / (p.X - DrawCanvas.ActualHeight)), 1) == Math.Round(((radarRadius[0].Y2 - DrawCanvas.ActualHeight) / (radarRadius[0].X2 - DrawCanvas.ActualHeight)), 1) || ((int)p.X == (int)DrawCanvas.ActualHeight && (int)radarRadius[0].X2 == (int)DrawCanvas.ActualHeight)) { Atia atia = new Atia(this, p.X, p.Y); atia.Run(false); } } else { } }