Let A, B, C and D be distinct points in 3 dimensional space.

Let AB denote the vector from A to B.

Any three points lie in a plane, so you need only check whether the fourth point lies in the same plane.

If you take the cross product of ABxAC, then this vector is perpendicular to the plane.

Now, if D is not on the plane, AD will not be lie in the plane, and so AD will not be perpindicular to ABxAC, and so AD(ABxAC) will be non-zero. Conversely, if it does lie on the plane, AD(ABxAC) will be zero. Therefore:

AD(ABxAC)=0 if and only if A,B,C and D all lie on the same plane.