Point2D GetMaxAngle(Point2D p1, Point2D p2)
    {
        float maxangle = float.NegativeInfinity;
        int   maxindex = 0;

        for (int i = 0; i < Points.Count; i++)
        {
            float angle = p2.AngleBetweenPoints(p1, Points[i]);
            if (maxangle < angle)
            {
                maxangle = angle;
                maxindex = i;
            }
        }
        return(Points[maxindex]);
    }