TriangleNet.NewLocation.PointBetweenPoints C# (CSharp) Method

PointBetweenPoints() private method

This function returns a pointer array which first index indicates the whether the point is in between the other points, followed by coordinate pairs.
private PointBetweenPoints ( double x1, double y1, double x2, double y2, double x, double y, double &p ) : void
x1 double P1 coordinates [point of line] (point on Voronoi edge - intersection)
y1 double P1 coordinates [point of line] (point on Voronoi edge - intersection)
x2 double P2 coordinates [point of line] (circumcenter)
y2 double P2 coordinates [point of line] (circumcenter)
x double P3 coordinates [point to be compared] (neighbor's circumcenter)
y double P3 coordinates [point to be compared] (neighbor's circumcenter)
p double
return void
        private void PointBetweenPoints(double x1, double y1, double x2, double y2, double x, double y, ref double[] p)
        {
            // now check whether the point is close to circumcenter than intersection point
            // BETWEEN THE POINTS
            if ((x2 - x) * (x2 - x) + (y2 - y) * (y2 - y) < (x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1))
            {
                p[0] = 1.0;
                // calculate the squared distance to circumcenter
                p[1] = (x - x2) * (x - x2) + (y - y2) * (y - y2);
                p[2] = x;
                p[3] = y;
            }// *NOT* BETWEEN THE POINTS
            else
            {
                p[0] = 0.0;
                p[1] = 0.0;
                p[2] = 0.0;
                p[3] = 0.0;
            }
        }