public static bool InCircleXZ(Vector3D p1, Vector3D p2, Vector3D p3, Vector3D p4) { Matrix4x4D m = Matrix4x4D.identity; Vector3D[] a = { p1, p2, p3, p4, }; for (int i = 0; i < 4; i++) { m.SetRow(i, new Vector4D(a[i].x, a[i].z, (a[i].x * a[i].x) + (a[i].z * a[i].z), 1)); } return(m.determinant < 0); }