Averaging nearby points in an array
Naming


plAveragedPoints   
paNearbyPoints   


this variables would be more obvious if you wouldn't use this strange kind of hungarian notation. I figured out the pl means point list and pa point array, but if you need to read this fast you just can't because your brain will try to decypher what pl and pa means.  

Does it really matter wether it is a List or an Array ?   




       if (!plAveragedPoints.Any(p =&gt; p.X == nX &amp;&amp; p.Y == nY))
        {
            plAveragedPoints.Add(new Point(nX, nY));
        }  



and  


       if (!plAveragedPoints.Any(p =&gt; p.X == points[pi].X &amp;&amp; p.Y == points[pi].Y))
        {
            plAveragedPoints.Add(points[pi]);
        }  



made me think that maybe a HashSet&lt;Point&gt; would be the better datastructure instead of a List&lt;Point. You could simply call the Add() method and forget about the result of it.  



Instead of using the tenary expression, @Caridoc had shown a different implementation which was a good start.  

I would suggest to add another method which takes two Func&lt;double,double&gt; which are determined before calling that overloaded method like so  

    private Func&lt;double, double&gt; CreateDesiredFunc(bool useFloor)
    {
        if (useFloor)
        {
            return Math.Floor;
        }
        return Math.Ceiling;
    }


Edit: Like @RickDavin pointed out in the comments this can be cleaned a little bit more by using more idiomatic names for the looping index variable and for the coordinate variables. In addition you should/could use the var type where it is clear from the right hand side of an assignment what type it is.  

This boils down to the following  

    private Point[] AverageNearbyPoints(Point[] points, bool averageLeft, bool averageHigh)
    {
        return AverageNearbyPoints(points, CreateDesiredFunc(averageLeft), CreateDesiredFunc(averageHigh));
    }

    private Point[] AverageNearbyPoints(Point[] points, Func&lt;double, double&gt; averageLeft, Func&lt;double, double&gt; averageHigh)
    {
        var averagedPoints = new HashSet&lt;Point&gt;();
        int numberOfPoints = points.Length;
        for (int i = 0; i &lt; numberOfPoints ; ++i)
        {
            var nearbyPoints = points.Where(p =&gt; (Math.Abs(p.X - points[i].X) &lt;= _nCornerTolerance)
                                              &amp;&amp; (Math.Abs(p.Y - points[i].Y) &lt;= _nCornerTolerance))
                                            .ToArray();
            var point = points[pi];

            if (nearbyPoints.Length &gt; 1)
            {
                int x = (int)averageLeft(nearbyPoints.Sum(p =&gt; p.X) / (float)nearbyPoints.Length);

                int y = (int)averageHigh(nearbyPoints.Sum(p =&gt; p.Y) / (float)nearbyPoints.Length);

                point = new Point(x, y);

            }

            averagedPoints.Add(point);
        }

        return averagedPoints.ToArray();
    }