コード例 #1
0
 public void Clear()
 {
     PlanePlotter.Clear();
     LinePlotter.Clear();
     LabelPlotter.Clear();
     ConePlotter.Clear();
 }
コード例 #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();
            }
        }
コード例 #3
0
        private static void PlotAxis(GameObject parent, Material material, Mesh mesh, float radius,
                                     Interval i, Axis axis)
        {
            double proportion = 0.15 / PlotUtils.scale;
            double step       = GetStep(i, proportion);

            Interval interval = AxisInterval(i, step);

            Point start = GetPoint(interval.a, axis);
            Point end   = GetPoint(interval.b, axis);

            LinePlotter.Plot(parent, start, end, material, mesh, radius);

            ConePlotter.Plot(parent, start, GetPoint(interval.a - (arrowHeight * proportion), axis),
                             arrowBaseScale, arrowPointScale, material);

            ConePlotter.Plot(parent, end, GetPoint(interval.b + (arrowHeight * proportion), axis),
                             arrowBaseScale, arrowPointScale, material);

            PlotMarks(parent, material, mesh, radius, interval.a, interval.b, step,
                      proportion, axis);
        }