Esempio n. 1
0
 public void Clear()
 {
     PlanePlotter.Clear();
     LinePlotter.Clear();
     LabelPlotter.Clear();
     ConePlotter.Clear();
 }
Esempio n. 2
0
        public void Plot(IPlotInput input)
        {
            if (input.functions.Length > 0)
            {
                PlotUtils.ResetScale();

                Clear();

                functions   = input.functions;
                independent = input.independent;
                dependent   = input.dependent;
                continuous  = true;
                closed      = true;

                continuousFunction = new bool[functions.Length];
                closedFunction     = new bool[functions.Length];

                functionPoints.Clear();

                for (int i = 0; i < functions.Length; i++)
                {
                    continuousFunction[i] = true;
                    closedFunction[i]     = true;
                    functionPoints.Add(new List <Point>());
                }

                BeforePlot(input);

                minI.Set(double.MaxValue);
                maxI.Set(double.MinValue);

                minD.Set(0, double.MaxValue);
                maxD.Set(0, double.MinValue);

                minF.Set(0, 0, double.MaxValue);
                maxF.Set(0, 0, double.MinValue);

                PlotFunctions(input.a, input.b, input.quality);

                AfterPlot(input.a, input.b, minI, maxI, minD, maxD, minF, maxF);

                PlotAxis();

                PlanePlotter.PlotActions();
                LinePlotter.PlotActions();
                ConePlotter.PlotActions();
                LabelPlotter.PlotActions();
            }
        }
Esempio n. 3
0
        private static void PlotLabel(GameObject parent, Material material, Axis axis,
                                      double proportion, double point)
        {
            Alignment alignment = axis == Axis.y ? Alignment.Right : Alignment.Center;
            double    dec       = Math.Abs(point - (int)point);
            string    message   = dec > 0.0 && Math.Abs(point) < 1.0? point.ToString("0.##") : ((int)point).ToString();

            double[] depths = new double[] { -0.001, 0.001 };

            foreach (double depth in depths)
            {
                LabelPlotter.Plot(parent, MarkLabelPoint(point, depth, proportion, axis, true),
                                  MarkLabelPoint(point, depth, proportion, axis, false), message, material.color, alignment);
            }
        }