コード例 #1
0
        public static PointPairList GetRegressionLine(this PointPairList pplTotal, double ratio)
        {
            var result = new PointPairList();

            result.Add(new PointPair(0.0, 0.0));
            if (ratio > 1)
            {
                double maxSample = pplTotal.Max(m => m.Y);

                result.Add(new PointPair(maxSample / ratio, maxSample));
            }
            else
            {
                double maxRef = pplTotal.Max(m => m.X);

                result.Add(new PointPair(maxRef, maxRef * ratio));
            }
            return(result);
        }