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;
}
}