TriangleNet.NewLocation.ChooseCorrectPoint C# (CSharp) Method

ChooseCorrectPoint() private method

Given three points, check if the point is the correct point that we are looking for.
private ChooseCorrectPoint ( double x1, double y1, double x2, double y2, double x3, double y3, bool isObtuse ) : bool
x1 double P1 coordinates (bisector point of dual edge on triangle)
y1 double P1 coordinates (bisector point of dual edge on triangle)
x2 double P2 coordinates (intersection point)
y2 double P2 coordinates (intersection point)
x3 double P3 coordinates (circumcenter point)
y3 double P3 coordinates (circumcenter point)
isObtuse bool
return bool
        private bool ChooseCorrectPoint(
            double x1, double y1,
            double x2, double y2,
            double x3, double y3, bool isObtuse)
        {
            double d1, d2;
            bool p;

            // squared distance between circumcenter and intersection point
            d1 = (x2 - x3) * (x2 - x3) + (y2 - y3) * (y2 - y3);
            // squared distance between bisector point and intersection point
            d2 = (x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1);

            if (isObtuse)
            {
                // obtuse case
                if (d2 >= d1)
                {
                    p = true; // means we have found the right point
                }
                else
                {
                    p = false; // means take the other point
                }
            }
            else
            {
                // non-obtuse case
                if (d2 < d1)
                {
                    p = true; // means we have found the right point
                }
                else
                {
                    p = false; // means take the other point
                }
            }
            /// HANDLE RIGHT TRIANGLE CASE!!!!!!!!!!!!!!!!!!!!!!!!!!!!
            return p;
        }