An algorithm for wheel rail contact geometry is proposed, which can detect single and
multi-contact rigid patches, or loss of contact of wheels with rails in dynamic simulation of railway
vehicles. The rigid contact patches are the bases to determine the penetration and curvatures for the
Hertz theory, the normal gap of the contact zones for non-Hertz theory, and the center and normal
direction for dynamic simulations. The validity of the proposed algorithm is verified with 3D
OpenGL graphs, and the algorithm has been applied to the development of simulation software for
full 3D vehicle system dynamics.