public void TransformPoints(Point3D[] points)
 {
     foreach (Point3D obj in points)
     {
         obj.Z = obj.Z / 100f * areaSceneDepth;
     }
     matrix3D.TransformPoints(points);
 }
        internal void Estimate3DInterval(ChartGraphics graph)
        {
            _ = (ChartArea)this;
            areaSceneWallWidth = graph.GetRelativeSize(new SizeF(Area3DStyle.WallWidth, Area3DStyle.WallWidth));
            ChartArea chartArea = (ChartArea)this;

            areaSceneDepth = GetEstimatedSceneDepth();
            RectangleF innerPlotRectangle = chartArea.Position.ToRectangleF();

            if (base.PlotAreaPosition.Width == 0f && base.PlotAreaPosition.Height == 0f && !chartArea.InnerPlotPosition.Auto && !chartArea.Position.Auto && !chartArea.InnerPlotPosition.Auto)
            {
                innerPlotRectangle.X     += chartArea.Position.Width / 100f * chartArea.InnerPlotPosition.X;
                innerPlotRectangle.Y     += chartArea.Position.Height / 100f * chartArea.InnerPlotPosition.Y;
                innerPlotRectangle.Width  = chartArea.Position.Width / 100f * chartArea.InnerPlotPosition.Width;
                innerPlotRectangle.Height = chartArea.Position.Height / 100f * chartArea.InnerPlotPosition.Height;
            }
            int      realYAngle = GetRealYAngle();
            Matrix3D matrix3D   = new Matrix3D();

            matrix3D.Initialize(innerPlotRectangle, areaSceneDepth, Area3DStyle.XAngle, realYAngle, Area3DStyle.Perspective, Area3DStyle.RightAngleAxes);
            Point3D[] array = new Point3D[8];
            bool      axisOnEdge;

            if (chartArea.switchValueAxes)
            {
                float marksZPosition = axisX.GetMarksZPosition(out axisOnEdge);
                array[0]       = new Point3D(innerPlotRectangle.X, innerPlotRectangle.Y, marksZPosition);
                array[1]       = new Point3D(innerPlotRectangle.X, innerPlotRectangle.Bottom, marksZPosition);
                marksZPosition = axisY.GetMarksZPosition(out axisOnEdge);
                array[2]       = new Point3D(innerPlotRectangle.X, innerPlotRectangle.Bottom, marksZPosition);
                array[3]       = new Point3D(innerPlotRectangle.Right, innerPlotRectangle.Bottom, marksZPosition);
                marksZPosition = axisX2.GetMarksZPosition(out axisOnEdge);
                array[4]       = new Point3D(innerPlotRectangle.X, innerPlotRectangle.Y, marksZPosition);
                array[5]       = new Point3D(innerPlotRectangle.X, innerPlotRectangle.Bottom, marksZPosition);
                marksZPosition = axisY2.GetMarksZPosition(out axisOnEdge);
                array[6]       = new Point3D(innerPlotRectangle.X, innerPlotRectangle.Y, marksZPosition);
                array[7]       = new Point3D(innerPlotRectangle.Right, innerPlotRectangle.Y, marksZPosition);
            }
            else
            {
                float marksZPosition = axisX.GetMarksZPosition(out axisOnEdge);
                array[0]       = new Point3D(innerPlotRectangle.X, innerPlotRectangle.Bottom, marksZPosition);
                array[1]       = new Point3D(innerPlotRectangle.Right, innerPlotRectangle.Bottom, marksZPosition);
                marksZPosition = axisY.GetMarksZPosition(out axisOnEdge);
                array[2]       = new Point3D(innerPlotRectangle.X, innerPlotRectangle.Y, marksZPosition);
                array[3]       = new Point3D(innerPlotRectangle.X, innerPlotRectangle.Bottom, marksZPosition);
                marksZPosition = axisX2.GetMarksZPosition(out axisOnEdge);
                array[4]       = new Point3D(innerPlotRectangle.X, innerPlotRectangle.Y, marksZPosition);
                array[5]       = new Point3D(innerPlotRectangle.Right, innerPlotRectangle.Y, marksZPosition);
                marksZPosition = axisY2.GetMarksZPosition(out axisOnEdge);
                array[6]       = new Point3D(innerPlotRectangle.X, innerPlotRectangle.Y, marksZPosition);
                array[7]       = new Point3D(innerPlotRectangle.X, innerPlotRectangle.Bottom, marksZPosition);
            }
            Axis[] axes = chartArea.Axes;
            foreach (Axis obj in axes)
            {
                obj.crossing = obj.tempCrossing;
            }
            matrix3D.TransformPoints(array);
            int num = 0;

            axes = chartArea.Axes;
            foreach (Axis axis in axes)
            {
                double num2 = Math.Sqrt((array[num].X - array[num + 1].X) * (array[num].X - array[num + 1].X) + (array[num].Y - array[num + 1].Y) * (array[num].Y - array[num + 1].Y));
                float  num3 = 1f;
                if (!chartArea.switchValueAxes)
                {
                    num3 = 0.5f;
                }
                if (axis.Type == AxisName.X || axis.Type == AxisName.X2)
                {
                    if (chartArea.switchValueAxes)
                    {
                        axis.interval3DCorrection = num2 / (double)innerPlotRectangle.Height;
                    }
                    else
                    {
                        axis.interval3DCorrection = num2 / (double)innerPlotRectangle.Width;
                    }
                }
                else if (chartArea.switchValueAxes)
                {
                    axis.interval3DCorrection = num2 / (double)innerPlotRectangle.Width;
                }
                else
                {
                    axis.interval3DCorrection = num2 / (double)innerPlotRectangle.Height * (double)num3;
                }
                if (axis.interval3DCorrection < 0.15)
                {
                    axis.interval3DCorrection = 0.15;
                }
                if (axis.interval3DCorrection > 0.8)
                {
                    axis.interval3DCorrection = 1.0;
                }
                num += 2;
            }
        }