lixiaojun
2025-01-22 46f64905a3c309a50c0f245b3350cdeb8dd699c6
WinFrmUI/Yw.WinFrmUI.Hydro.Q3d.Core/MapView/Common/Dataset.cs
@@ -1,6 +1,7 @@
using MathNet.Numerics.LinearAlgebra.Double; // 引入 Math.NET Numerics 库进行多项式拟合
using MathNet.Numerics;
using MathNet.Numerics;
using MathNet.Numerics.LinearAlgebra;
using MathNet.Numerics.LinearAlgebra.Double; // 引入 Math.NET Numerics 库进行多项式拟合
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Drawing;
@@ -10,7 +11,6 @@
//using System.Windows.Forms.DataVisualization.Charting;
using Yw.WinFrmUI.Q3d;
using Yw.WinFrmUI.Q3d;
using Newtonsoft.Json;
using Yw.WinFrmUI.Q3d;
namespace Yw.WinFrmUI.Q3d
@@ -51,13 +51,13 @@
                {
                    case "流量扬程曲线":
                        return Color.Blue;
                        //break;
                    //break;
                    case "流量功率曲线":
                        return Color.Orange;
                        //break;
                    //break;
                    case "流量效率曲线":
                        return Color.Red;
                        //break;
                    //break;
                    default:
                        return Color.Blue;
                }
@@ -204,7 +204,8 @@
            if (range_X == null)
            {
                range_X = new DRange(double.MaxValue, double.MinValue);
                Data.ForEach(p => {
                Data.ForEach(p =>
                {
                    if (range_X.Min > p.X) range_X.Min = p.X;
                    if (range_X.Max < p.X) range_X.Max = p.X;
                });
@@ -283,9 +284,9 @@
                double b = coefficients[1]; // 一次项系数
                double c = coefficients[0] - y; // 常数项系数减去给定的 y 值
                var roots = MathSolver.Solve(a, b, c);
                if (roots == null)return ErrNum;
                if (roots == null) return ErrNum;
                else return roots.Max();
            }
@@ -312,7 +313,7 @@
            //}
            else
            {
                return Solve(y);
            }
        }