/// <summary>
        /// Применить алгоритм Дугласа-Пекера к жесту
        /// </summary>
        /// <returns> Упрощенный список</returns>
        public List <Point> DouglasPeucker()
        {
            if (points.Count == 0)
            {
                return(null);
            }
            var newListPoints = DouglasPeuckerSimplification.DouglasPeucker(points, count);

            points = newListPoints;
            return(newListPoints);
        }
        /// <summary>
        /// Упрощение списка точек методом Дугласа-Пекера
        /// </summary>
        /// <param name="points"> Список точек, который сокращается</param>
        /// <param name="count"> Сколько точек нужно</param>
        /// <returns></returns>
        public static List <Point> DouglasPeucker(List <Point> points, int count)
        {
            DouglasPeuckerSimplification.points     = points;
            DouglasPeuckerSimplification.result     = new List <int>();
            DouglasPeuckerSimplification.countPoint = count;
            epsilon = DouglasPeuckerSimplification.CalculateEpsilon(40);
            FindResultPoint();
            if (countPoint != result.Count)
            {
                var countDifference = Math.Abs(countPoint - result.Count);
                if (countPoint > result.Count)
                {
                    AddPoint(countDifference);
                }
                else
                {
                    DeletePoint(countDifference);
                }
            }
            var resultPoint = ResultPoint();

            return(resultPoint);
        }