The Möller–Trumbore ray-triangle intersection algorithm, named after its inventors Tomas Möller and Ben Trumbore, is a fast method for calculating the intersection of a ray and a triangle in three dimensions without needing precomputation of the plane equation of the plane containing the triangle. Among other uses, it can be used in computer graphics to implement ray tracing computations involving triangle meshes.
Pseudocode
Assuming a Vec3 datatype and the SUB (element-wise subtraction), CROSS, and DOT operations, the following C program describes the algorithm:
References
Möller–Trumbore intersection algorithm Wikipedia(Text) CC BY-SA