public PointPatternMatchResult GetPointPatternMatchResult(PointsPatternSet CompareTo, Point[] Points)
        {
            PointPatternMatchResult comparisonResults = new PointPatternMatchResult();

            if (CompareTo.Points.Length == 1 || Points.Length <= 1)
            {
                if (Points.Length == CompareTo.Points.Length)
                {
                    comparisonResults.Probability = 100d;
                }
                else
                {
                    comparisonResults.Probability = 0d;
                }
            }
            else
            {
                double[] aDeltas          = new double[Precision];
                double[] aCompareToAngles = PointPatternMath.GetPointArrayAngularMargins(PointPatternMath.GetInterpolatedPointArray(CompareTo.Points, Precision));
                double[] aCompareAngles   = PointPatternMath.GetPointArrayAngularMargins(PointPatternMath.GetInterpolatedPointArray(Points, Precision));

                for (int i = 0; i <= aCompareToAngles.Length - 1; i++)
                {
                    aDeltas[i] = PointPatternMath.GetAngularDelta(aCompareToAngles[i], aCompareAngles[i]);
                }

                // Create new PointPatternMatchResult object to hold results from comparison
                comparisonResults.Probability = PointPatternMath.GetProbabilityFromAngularDelta(aDeltas.Average());
            }
            comparisonResults.Name = CompareTo.Name;
            comparisonResults.PointPatternSetCount = 1;
            // Return results of the comparison
            return(comparisonResults);
        }
 public double[] GetAngularMargins(int precision)
 {
     if (_angularMargins == null)
     {
         _angularMargins = PointPatternMath.GetPointArrayAngularMargins(PointPatternMath.GetInterpolatedPointArray(Points, precision));
     }
     return(_angularMargins);
 }