This generates a random triangle off of 3 points and calculates the normal of the triangle by vector multiplication.The normal is represented by the dark pink vector. The random points are points which lie on a function generated by the normal. Then a random line is generated, which is then tested to see if it intersects with the plane.
And line-plane intersection. All blocks are mine so if you use one, add credit.