Calculation of the van der Waals potential energy for polyethylene and polytetrafluoroethylene as two-atom and three-atom chains: rotational freedom in the crystals