public void Plot_Gradient(TransForm tr, Graphics2D g2) {
        /* all about the gradient for display */
        this.Plane_Ramp_To_Normal(normal);
        double hgt = this.loc[0];
        double grad_x0;
        double grad_y0;
        double grad_x1, grad_y1;
        PointNd steepest = new PointNd(ndims);
        normal.Get_Steepest(steepest);
        if (normal.loc.length > 1) {
          boolean nop = true;
        } else {
          boolean nop = true;
        }
        double[] ratios = new double[ninputs];// the ratios are NOT the inverse slopes.  they are from the steepest line.
        for (int cnt = 0; cnt < ninputs; cnt++) {
          ratios[cnt] = steepest.loc[cnt] / steepest.loc[ninputs];// inverse slope for each shadow of the steepest
        }
        if (true) {
          double offset = this.loc[ninputs];
          double height0 = -1.0 - offset;
          double height1 = 1.0 - offset;
          double brad = tr.xscale;// Bounds.Rad(ninputs);
          //gradx0 = (int) (brad * (height0 * ratios[0])); grad_y0 = (int) (brad * (height0 * ratios[1])); grad_x1 = (int) (brad * (height1 * ratios[0])); grad_y1 = (int) (brad * (height1 * ratios[1]));
          height0 *= brad;
          height1 *= brad;
          grad_x0 = (int) ((height0 * ratios[0]));
          grad_y0 = (int) ((height0 * ratios[1]));
          grad_x1 = (int) ((height1 * ratios[0]));
          grad_y1 = (int) ((height1 * ratios[1]));
        }
        Color startColor = new Color(0.0f, 0.0f, 1.0f);//Color startColor = Color.blue;
        Color endColor = new Color(1.0f, 0.0f, 0.0f);//Color endColor = Color.red;

        GradientPaint gradient;

        gradient = new GradientPaint((int) (tr.xoffs + grad_x0), (int) (tr.yoffs + grad_y0), startColor, (int) (tr.xoffs + grad_x1), (int) (tr.yoffs + grad_y1), endColor);// A non-cyclic gradient
        g2.setPaint(gradient);

        if (true) {
          int rxorg = (int) (tr.xoffs - tr.xscale);
          int ryorg = (int) (tr.yoffs - tr.yscale);
          int rwdt = (int) (2.0 * tr.xscale);
          int rhgt = (int) (2.0 * tr.yscale);
          g2.fillRect(rxorg, ryorg, rwdt, rhgt);
          g2.setColor(Color.white);
          g2.drawLine((int) (tr.xoffs + grad_x0), (int) (tr.yoffs + grad_y0), (int) (tr.xoffs + grad_x1), (int) (tr.yoffs + grad_y1));
        }
      }