It is not easy to calculate the force of gravitational attraction between extended objects that do not have spherical symmetry. For two uniform rods lying along the x-axis one can find an analytic expression for the force of attraction, but the expression goes to infinity as the rods approach each other unless the rods are given a finite cross-section. Here we look at the interaction between rods of length D using a model that specifies the cross-section: a set of N identical spheres glued together along a common axis. The rods are released from rest with one along the x-axis with its center at (D/2, 0), and the other perpendicular to the x-axis with its center at (2*D, D/2). The motion is followed until the rods collide. The program lets you set N (the length to diameter ratio for a rod) to either 8 or 16.
Since the center of mass of the system (marked by a cross) remains stationary, and the total linear momentum is zero, we need only calculate the velocity of the center of one rod (the other's velocity will be equal and oppositely directed). The total angular momentum of the system is zero, but this does not mean that the rods acquire balancing angular momenta about their centers - the motion of the rod centers also contributes to the angular momentum of the system. When the program is run, it is clear that the clockwise rotation of the vertical rod exceeds the counterclockwise rotation of the horizontal rod, but the balancing counterclockwise rotation of the rod centers is harder to detect.