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 void PlotArea()
        {
            bottomAreaPoints.Reverse();

            List <Point> areaPoints = topAreaPoints.Concat(bottomAreaPoints).ToList();

            if (areaPoints.Count == 0)
            {
                return;
            }

            PlanePlotter.Plot(parent, areaPoints, planeMaterials[0], PlaneView.Both);

            CalculateArea();

            ClearAreaPoints();
        }
        private void PlotPlane(List <Point> top, List <Point> bottom)
        {
            List <Point> reversed = new List <Point>(bottom);

            reversed.Reverse();

            if (IsSamePoint(top.First(), reversed.Last()))
            {
                reversed.RemoveAt(reversed.Count - 1);
            }

            if (IsSamePoint(top.Last(), reversed.First()))
            {
                top.RemoveAt(top.Count - 1);
            }

            List <Point> points = top.Concat(reversed).ToList();

            PlanePlotter.Plot(parent, points, planeMaterials[0], PlaneView.Both);
        }
Esempio n. 5
0
    private void Start()
    {
        List <Point> points = new List <Point>();

        points.Add(new Point(0, 1, 1));
        points.Add(new Point(1, 0, 1));
        points.Add(new Point(2, -1, 1));
        points.Add(new Point(3, -1, 1));
        points.Add(new Point(4, 0, 1));
        points.Add(new Point(5, 1, 1));

        points.Add(new Point(5, 1, 0));
        points.Add(new Point(4, 0, 0));
        points.Add(new Point(3, -1, 0));
        points.Add(new Point(2, -1, 0));
        points.Add(new Point(1, 0, 0));
        points.Add(new Point(0, 1, 0));

        Plot(points);

        points.Clear();

        points.Add(new Point(0, 1, -1.5));

        points.Add(new Point(1, 0, -1));
        points.Add(new Point(2, -1, -1));
        points.Add(new Point(3, -1, -1));
        points.Add(new Point(4, 0, -1));

        points.Add(new Point(5, 1, -1.5));

        points.Add(new Point(4, 0, -2));
        points.Add(new Point(3, -1, -2));
        points.Add(new Point(2, -1, -2));
        points.Add(new Point(1, 0, -2));

        Plot(points);

        PlanePlotter.PlotActions();
        LinePlotter.PlotActions();
    }
        private void CalculateVolume(double a, double b)
        {
            if (!continuous)
            {
                PlanePlotter.ClearActions();
                volume = double.NaN;
            }
            else
            {
                IFunction vFunction;

                if (rotate == independent) // disc method
                {
                    vFunction = functions[0].Generate("(function)^2");
                    volume    = Math.PI * integrator.Integrate(vFunction, a, b).value;
                }
                else // washer method
                {
                    vFunction = functions[0].Generate(independent.ToString() + "*(function)");
                    volume    = 2 * Math.PI * integrator.Integrate(vFunction, a, b).value;
                }
            }
        }
Esempio n. 7
0
 private void Plot(List <Point> points)
 {
     PlanePlotter.Plot(parent, points, planeMaterial, PlaneView.Top);
     PlotBorder(points);
 }