private void UpdateCircularBumperPlot()
        {
            double x1 = _newBumper.CircularBumper1Left;
            double y1 = _newBumper.CircularBumper1Top;
            double x2 = _newBumper.CircularBumper2Left;
            double y2 = _newBumper.CircularBumper2Top;
            double x3 = _newBumper.CircularBumper3Left;
            double y3 = _newBumper.CircularBumper3Top;

            double C12 = Bumper.CalculateConstantC(x1, y1, x2, y2);
            double C23 = Bumper.CalculateConstantC(x2, y2, x3, y3);
            double D12 = Bumper.CalculateConstantD(x1, y1, x2, y2);
            double D23 = Bumper.CalculateConstantD(x2, y2, x3, y3);

            double b = (C23 - C12) / (D23 - D12);
            double a = C12 - b * D12;
            double r = Math.Sqrt(Math.Pow((x1 - a), 2) + Math.Pow((y1 - b), 2));

            if (!(double.IsNaN(a) || double.IsNaN(b) || double.IsNaN(r) ||
                  double.IsInfinity(a) || double.IsInfinity(b) || double.IsInfinity(r)))
            {
                FullCircularBumper.Margin = new Thickness(a - r, b - r, 0, 0);
                FullCircularBumper.Height = 2 * r;
                FullCircularBumper.Width  = 2 * r;
            }
        }
Exemplo n.º 2
0
 public BruteForceMethods(ODESolution newOdeSolution, Bumper newBumper, NeuralNetworkParameters newNetworkParameters)
 {
     this._newOdeSolution       = newOdeSolution;
     this._newBumper            = newBumper;
     this._newNetworkParameters = newNetworkParameters;
     _newPowerAngleFinder       = new StartPowerAngleFinder();
 }