public static bool IsConvexQuad(Vector3 a, Vector3 b, Vector3 c, Vector3 d) { var vector = Vector3.Cross(d - b, a - b); var vector2 = Vector3.Cross(d - b, c - b); if (Vector3.Dot(vector, vector2) >= 0f) { return false; } var vector3 = Vector3.Cross(c - a, d - a); var vector4 = Vector3.Cross(c - a, b - a); return (Vector3.Dot(vector3, vector4) < 0f); }